ImageMaps

ImageMaps

131k Downloads

NullPointerException

sebastianbinder opened this issue · 4 comments

commented

Hey @SydMontague
Sometimes I'm getting this error when trying to place an image.
Should be the same issue even if the error is thrown twice since PlayerInteractEvent is getting fired twice because of having two hands.

[12:03:37 ERROR]: Could not pass event PlayerInteractEvent to ImageMaps v0.4.2
org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at org.bukkit.craftbukkit.v1_9_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:227) [spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at net.minecraft.server.v1_9_R1.PlayerInteractManager.a(PlayerInteractManager.java:482) [spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at net.minecraft.server.v1_9_R1.PlayerConnection.a(PlayerConnection.java:852) [spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at net.minecraft.server.v1_9_R1.PacketPlayInUseItem.a(SourceFile:55) [spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at net.minecraft.server.v1_9_R1.PacketPlayInUseItem.a(SourceFile:11) [spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at net.minecraft.server.v1_9_R1.PlayerConnectionUtils$1.run(SourceFile:13) [spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_66]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_66]
        at net.minecraft.server.v1_9_R1.SystemUtils.a(SourceFile:45) [spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at net.minecraft.server.v1_9_R1.MinecraftServer.D(MinecraftServer.java:721) [spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at net.minecraft.server.v1_9_R1.DedicatedServer.D(DedicatedServer.java:400) [spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at net.minecraft.server.v1_9_R1.MinecraftServer.C(MinecraftServer.java:660) [spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at net.minecraft.server.v1_9_R1.MinecraftServer.run(MinecraftServer.java:559) [spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_66]
Caused by: java.lang.NullPointerException
        at org.bukkit.craftbukkit.v1_9_R1.CraftWorld.createEntity(CraftWorld.java:1079) ~[spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at org.bukkit.craftbukkit.v1_9_R1.CraftWorld.spawn(CraftWorld.java:1135) ~[spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at org.bukkit.craftbukkit.v1_9_R1.CraftWorld.spawn(CraftWorld.java:851) ~[spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at de.craftlancer.imagemaps.ImageMaps.setItemFrame(ImageMaps.java:149) ~[?:?]
        at de.craftlancer.imagemaps.ImageMaps.placeImage(ImageMaps.java:121) ~[?:?]
        at de.craftlancer.imagemaps.ImageMaps.onInteract(ImageMaps.java:137) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_66]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_66]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_66]
        at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_66]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        ... 17 more
[12:03:37 ERROR]: Could not pass event PlayerInteractEvent to ImageMaps v0.4.2
org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at org.bukkit.craftbukkit.v1_9_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:227) [spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at net.minecraft.server.v1_9_R1.PlayerInteractManager.a(PlayerInteractManager.java:482) [spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at net.minecraft.server.v1_9_R1.PlayerConnection.a(PlayerConnection.java:852) [spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at net.minecraft.server.v1_9_R1.PacketPlayInUseItem.a(SourceFile:55) [spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at net.minecraft.server.v1_9_R1.PacketPlayInUseItem.a(SourceFile:11) [spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at net.minecraft.server.v1_9_R1.PlayerConnectionUtils$1.run(SourceFile:13) [spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_66]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_66]
        at net.minecraft.server.v1_9_R1.SystemUtils.a(SourceFile:45) [spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at net.minecraft.server.v1_9_R1.MinecraftServer.D(MinecraftServer.java:721) [spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at net.minecraft.server.v1_9_R1.DedicatedServer.D(DedicatedServer.java:400) [spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at net.minecraft.server.v1_9_R1.MinecraftServer.C(MinecraftServer.java:660) [spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at net.minecraft.server.v1_9_R1.MinecraftServer.run(MinecraftServer.java:559) [spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_66]
Caused by: java.lang.NullPointerException
        at org.bukkit.craftbukkit.v1_9_R1.CraftWorld.createEntity(CraftWorld.java:1079) ~[spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at org.bukkit.craftbukkit.v1_9_R1.CraftWorld.spawn(CraftWorld.java:1135) ~[spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at org.bukkit.craftbukkit.v1_9_R1.CraftWorld.spawn(CraftWorld.java:851) ~[spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        at de.craftlancer.imagemaps.ImageMaps.setItemFrame(ImageMaps.java:149) ~[?:?]
        at de.craftlancer.imagemaps.ImageMaps.placeImage(ImageMaps.java:121) ~[?:?]
        at de.craftlancer.imagemaps.ImageMaps.onInteract(ImageMaps.java:137) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_66]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_66]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_66]
        at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_66]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.9-2016-03-04-01.jar:git-Spigot-87e2f47-ef13ca4]
        ... 17 more
commented

Thanks for the report.

It looks like I was able to pinpoint this error to there not being any space for the ItemFrame to attach to.

I uploaded a fix for it (and another bug I found while reproducing it), confirmation whether it works or not would be appreciated. :)

commented

@SydMontague
Thank :) I'll let you know if there is any error coming up again.

Another question: How come that after placing the images and a server restart sometimes (or quite often ^^) the images are not getting sent to the clients? Or in general: are the images getting placed into the frames and simply everybody can see time as sent from Spigot or do you send/modify packages sent to the client?

commented

There are 2 modes, fast send and normal send. It works on per-image base and can be enabled when placing it with the command '/imagemaps true'.
Images in fast send mode will be sent as a whole to every client once they connect, the others will be sent in whatever way Minecraft/the Server implementation seems fitting.

commented

Okay. Thank you for your explanation. Nevertheless, sometimes those maps are not getting sent to the client. Even after removing them and placing them again or reloading them… I'm kinda helpless xD