Extra Hard Mode

Extra Hard Mode

63.1k Downloads

getArmorPoints null pointer exception

Pilvinen opened this issue ยท 19 comments

commented

Found this error happening periodically on console.

Spigot version: This server is running CraftBukkit version git-Spigot-3104eb1-daf4514 (MC: 1.9) (Implementing API version 1.9-R0.1-SNAPSHOT)
EHM version: 3.7.1

[14:53:52 WARN]: [ExtraHardMode] Task #61 for ExtraHardMode v3.7.1 generated an exception
java.lang.NullPointerException
        at com.extrahardmode.module.PlayerModule.getArmorPoints(PlayerModule.java:227) ~[?:?]
        at com.extrahardmode.task.ArmorWeightTask.run(ArmorWeightTask.java:43) ~[?:?]
        at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftTask.run(CraftTask.java:71) ~[spigot-1.9.jar:git-Spigot-3104eb1-daf4514]
        at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350) [spigot-1.9.jar:git-Spigot-3104eb1-daf4514]
        at net.minecraft.server.v1_9_R1.MinecraftServer.D(MinecraftServer.java:729) [spigot-1.9.jar:git-Spigot-3104eb1-daf4514]
        at net.minecraft.server.v1_9_R1.DedicatedServer.D(DedicatedServer.java:400) [spigot-1.9.jar:git-Spigot-3104eb1-daf4514]
        at net.minecraft.server.v1_9_R1.MinecraftServer.C(MinecraftServer.java:660) [spigot-1.9.jar:git-Spigot-3104eb1-daf4514]
        at net.minecraft.server.v1_9_R1.MinecraftServer.run(MinecraftServer.java:559) [spigot-1.9.jar:git-Spigot-3104eb1-daf4514]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_72]
`
commented

No I can't. I should have checked what players were doing at the moment when I was getting those errors.

I tested swimming and running.

That error happened every 4 seconds.

I don't know if this is related or should open a new bug but I'm now getting every 3 seconds this:

[20:46:29] [Server thread/WARN]: [ExtraHardMode] Task #61 for ExtraHardMode v3.7.1 generated an exception java.lang.NullPointerException

commented

Idk what that one is without the full stacktrace

commented

It doesn't have one. That is the full error.

commented

Also, use three back ticks instead of 1 to provide proper line spacing.

commented

Um, that's odd... Idk where the NPE is occurring in that second one without a stack trace...

commented

Here is longer paste from the log:
http://pastie.org/private/c2mfo11hmxyrph0bxqtuw

commented

Actually, it might be due to someone wearing partial armor? There's no null checks in the code, that could be why but I'm wondering why that is.

commented

Can you reliably reproduce this (put armor on yourself, walk/run with it on)? Wondering if it might have to do Elytra and/or those inventory changes.

commented

Not entirely sure, didn't have time to read the changes, was just skimming through commits to see if anything has changed. However, I'm getting no errors on Paper, which hasn't seemed to have pulled that commit yet... so not sure what to do right now other than wait and see if/when there's more info about their armor/inventory changes.

That being said, there's methods for getting each piece of armor, so I might alter the code to use that instead of iterating through armor ids or whatever.

commented

I don't have many players on my server yet.
However, the spam starts as soon as a player joins. Stops when all players leave. Even myself. No armor or anything.
I have EHM set to ignore players in creative (OPs only), and it still spams.

If it helps you any, the same thing is happening to EnchantsPlus.

commented

Does EnchantsPlus have a github repo? If they do you could also paste the error for their log and I can see if there's any similarities.

commented

They are a premium, I don't think have their stuff is opensourced.
https://www.spigotmc.org/resources/enchantsplus.3396/

Here is my start, join for a little bit, leave, and shutdown log.
http://pastebin.com/xYxLeLuD

commented

Hmm, when I was testing stuff on my server yesterday I wasn't wearing any armor and did not have any logspam. That being said, I am using Paper, so it might've been a very recent change (i.e. something done within the last 24 hours) in Spigot.

commented

As far as I can tell, they changed how inventory is managed? Translation for those interested? lol

commented

While you (and I) are waiting, you could temporarily use paper instead of spigot for now, which should be 100% compatible with your server

commented

Huh, no errors when a full set of armor is worn. Interesting. Missing one piece though triggers the errors.

commented

Alright, now able to reproduce on paper as well.