Toggle Area trows a NPE
LadyCailinBot opened this issue ยท 2 comments
CRAFTBOOK-2341 - Reported by untergrundbiber
CraftBook v1597
Craftbukkit 1.4.6-R0.4
When i try to toggle an area with the "[Area]"-Sign it throws me that on the console:
org.bukkit.event.EventException
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427)
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:35)
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477)
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462)
at org.bukkit.craftbukkit.v1_4_6.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:178)
at net.minecraft.server.v1_4_6.PlayerInteractManager.interact(PlayerInteractManager.java:376)
at net.minecraft.server.v1_4_6.PlayerConnection.a(PlayerConnection.java:656)
at net.minecraft.server.v1_4_6.Packet15Place.handle(SourceFile:58)
at net.minecraft.server.v1_4_6.NetworkManager.b(NetworkManager.java:290)
at net.minecraft.server.v1_4_6.PlayerConnection.d(PlayerConnection.java:112)
at net.minecraft.server.v1_4_6.ServerConnection.b(SourceFile:39)
at net.minecraft.server.v1_4_6.DedicatedServerConnection.b(SourceFile:30)
at net.minecraft.server.v1_4_6.MinecraftServer.r(MinecraftServer.java:585)
at net.minecraft.server.v1_4_6.DedicatedServer.r(DedicatedServer.java:224)
at net.minecraft.server.v1_4_6.MinecraftServer.q(MinecraftServer.java:481)
at net.minecraft.server.v1_4_6.MinecraftServer.run(MinecraftServer.java:416)
at net.minecraft.server.v1_4_6.ThreadServerApplication.run(SourceFile:849)
Caused by: java.lang.NullPointerException
at com.sk89q.craftbook.mech.area.Area.onRightClick(Area.java:127)
at com.sk89q.craftbook.MechanicManager.dispatchBlockRightClick(MechanicManager.java:237)
at com.sk89q.craftbook.bukkit.MechanicListenerAdapter$MechanicPlayerListener.onPlayerInteract(MechanicListenerAdapter.java:137)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425)
... 17 more
Also when i try to save a new area with "/area save test123" Craftbook says me that the namespace is invalid because my minecraft-name is too long. I think i am not the only person with a 15 characters long minecraft-name.
It's pretty annoying of specifying a namespace when I create a area and in older versions it went so well with my long name.
Comment by me4502
When did you get your minecraft account? It doesn't allow names longer than 12/14 anymore IIRC... I will try to add support for longer names, but it is hard to get it right, as someone could be called "superbillythebest1" and someone else, "superbillythebest2"... and they would then fall under the same namespace.
As for the error, I am looking into that
Edit: Fixed the error.
Edit: For the namespace issue, why not use a different namespace? I am sure you could think of something less than 15 letters long to save your areas under.
Edit: I implemented an option that will shorten names longer than 14 chars... So the issue is optional.
Comment by untergrundbiber
Thanks for fixing.
About the namespace-thing: I have my account since over 2 years now and i know serveral other players on my server with names over 13 chars. While it is annoying to specify the namespace anytime, but if it really a big problem in the code I think it is acceptable with the shorten names. ;)