SpectatorPlus

SpectatorPlus

34.1k Downloads

Null Pointer Exception on player death

Amunak opened this issue ยท 2 comments

commented

Latest jenkins build (#24 I think) on Spigot 1.7.9-R0.2-207 (Minecraft 1.7.10); on player death I get this:

[21:31:03 ERROR]: Could not pass event PlayerDeathEvent to SpectatorPlus v2.0
org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:509) [spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:494) [spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at org.bukkit.craftbukkit.v1_7_R4.event.CraftEventFactory.callPlayerDeathEvent(CraftEventFactory.java:397) [spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.EntityPlayer.die(EntityPlayer.java:386) [spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.EntityLiving.damageEntity(EntityLiving.java:745) [spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.EntityHuman.damageEntity(EntityHuman.java:765) [spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.EntityPlayer.damageEntity(EntityPlayer.java:465) [spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.EntityHuman.attack(EntityHuman.java:950) [spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.PlayerConnection.a(PlayerConnection.java:1204) [spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.PacketPlayInUseEntity.a(PacketPlayInUseEntity.java:37) [spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.PacketPlayInUseEntity.handle(PacketPlayInUseEntity.java:49) [spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.NetworkManager.a(NetworkManager.java:186) [spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.ServerConnection.c(ServerConnection.java:81) [spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:734) [spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:289) [spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:584) [spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:490) [spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628) [spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
Caused by: java.lang.NullPointerException
        at com.pgcraft.spectatorplus.SpectateListener.onPlayerDeath(SpectateListener.java:742) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_67]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_67]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_67]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_67]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:298) ~[spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        ... 19 more
commented

Hmm... I'll have to look into this. #blame @AmauryCarrade :D That's because Amaury did those last few commits. I haven't had a chance to fully test them yet, and as I recall they changed the code to save the death reason.

commented

This may be caused by a plugin removing the death messages.

The fix is simple. Wait for a PR.