HawkReloaded
HawkReloaded copied to clipboard
NPE on breaking a bed block
/version hawkeye
reports 1.7.2.
2016-05-06 18:58:49 [Server thread/ERROR] Could not pass event BlockBreakEvent to HawkEye v1.7.2
org.bukkit.event.EventException
at uk.co.oliwali.HawkEye.listeners.HawkEyeListener$1.execute(HawkEyeListener.java:55) ~[?:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:78) ~[patched_1.9.2.jar:git-Paper-723]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[patched_1.9.2.jar:git-Paper-723]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:517) [patched_1.9.2.jar:git-Paper-723]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:502) [patched_1.9.2.jar:git-Paper-723]
at net.minecraft.server.v1_9_R1.PlayerInteractManager.breakBlock(PlayerInteractManager.java:292) [patched_1.9.2.jar:git-Paper-723]
at net.minecraft.server.v1_9_R1.PlayerInteractManager.a(PlayerInteractManager.java:218) [patched_1.9.2.jar:git-Paper-723]
at net.minecraft.server.v1_9_R1.PlayerConnection.a(PlayerConnection.java:847) [patched_1.9.2.jar:git-Paper-723]
at net.minecraft.server.v1_9_R1.PacketPlayInBlockDig.a(SourceFile:40) [patched_1.9.2.jar:git-Paper-723]
at net.minecraft.server.v1_9_R1.PacketPlayInBlockDig.a(SourceFile:10) [patched_1.9.2.jar:git-Paper-723]
at net.minecraft.server.v1_9_R1.PlayerConnectionUtils$1.run(SourceFile:13) [patched_1.9.2.jar:git-Paper-723]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_72]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_72]
at net.minecraft.server.v1_9_R1.SystemUtils.a(SourceFile:45) [patched_1.9.2.jar:git-Paper-723]
at net.minecraft.server.v1_9_R1.MinecraftServer.D(MinecraftServer.java:813) [patched_1.9.2.jar:git-Paper-723]
at net.minecraft.server.v1_9_R1.DedicatedServer.D(DedicatedServer.java:404) [patched_1.9.2.jar:git-Paper-723]
at net.minecraft.server.v1_9_R1.MinecraftServer.C(MinecraftServer.java:723) [patched_1.9.2.jar:git-Paper-723]
at net.minecraft.server.v1_9_R1.MinecraftServer.run(MinecraftServer.java:622) [patched_1.9.2.jar:git-Paper-723]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_72]
Caused by: java.lang.NullPointerException
at org.bukkit.craftbukkit.v1_9_R1.block.CraftBlock.getRelative(CraftBlock.java:195) ~[patched_1.9.2.jar:git-Paper-723]
at org.bukkit.craftbukkit.v1_9_R1.block.CraftBlock.getRelative(CraftBlock.java:191) ~[patched_1.9.2.jar:git-Paper-723]
at uk.co.oliwali.HawkEye.blocks.BedBlock.getCorrectBlock(BedBlock.java:49) ~[?:?]
at uk.co.oliwali.HawkEye.listeners.MonitorBlockListener.onBlockBreak(MonitorBlockListener.java:38) ~[?:?]
at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_72]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_72]
at uk.co.oliwali.HawkEye.listeners.HawkEyeListener$1.execute(HawkEyeListener.java:52) ~[?:?]
... 18 more
I figured 1.9 would give us troubles. I'll have to setup a 1.9 test enviroment to find the "new?" data values for the bed.
This is caused by the beds facing an unknown direction resulting in HawkEye unable to determine their initial block, and extending block.
Also, does this happen on any direction? We'll have to include some byte math to find the proper rotations for now on instead of hand cording known values i suppose.
Also, does this happen on any direction? We'll have to include some byte math to find the proper rotations for now on instead of hand cording known values i suppose.
Couldn't reproduce it for whatever reason. I believe the bed that was broken was facing with pillow towards south.
So is this nullpointer a frequent or rare exception? If it's rare, i'll likely just ignore the logg if the direction is "unknown". I'm guessing someone set a weird data value using worldedit.
survival world, so nobody used WorldEdit for that (I only had access, and it's been uninstalled for many months). So unfortunately not sure. Perhaps it happened while someone was sleeping in it? Either way, first time I saw it in my console, I'll check my logs for any other occurrences - so probably rare.
The data value shouldn't change when somebody is sleeping on it. It only has a total of 4 states and those are simply the directions. If you're able to figure out how this is reproduced it'd be very very helpful.
My best guess is somehow one side of the bed is being removed without altering the other side which would screw with HawkEye's logging. This can be done if physics isn't applied to a block (Which plugins CAN do, HawkEye even does it).
So that's the only time it errored, log search doesn't indicate any other instances of failing to pass this event. Will continue to monitor.