Major Bug when saving map
Opened this issue ยท 12 comments
I am more than sure this is a bug when I am saving the map properly via '/za game mapdata save' . After the command is executed, it tells me to select the opposite corners of my map so when i attempt to do so, it reads the first corner just fine but I get no message after the second corner and it lagged a little. Nothing happened so I tried to redo the command so I did, and tried to choose the corners again. Same problem. A minute late my server crashed and when I relogged, all of my map building from 5 hours prior to when I first logged in was erased, as if I never even started. However, it was strange to notice that a very very small chunk of my map was still there from when I finished before the crash, it was about 10 blocks left on that chunk. I am back to having 15-20% of my map complete, and I am afraid to build it again in case of another crash when trying to save it. I should mention that I am building my map in a void map, which is where there is no ground, only the void below the map, so sort of like a floating island. When I made the 3 passages in my map, part of the blinkers for them appeared approximately 60 or so blocks below the actual passage. I tried to remove and then remake those passages so I did and the same occurred. When I wanted to save the map, I knew that the corners needed to include the blinkers so I made one corner level with the stray blinkers and went to save the map with the command, and that is when the crash occurred. I could not figure out why there were blinker there but I continued to proceed with saving the map because I thought that the blinkers there would not do any harm. I should also mention that I have three differently shaped passages; first height, then width: a 2x3, 2x1, and a 2x2. I think I said everything I needed to say and sorry for long post.
[INFO] kball_ issued server command: /za game mapdata NachtDerUntoten save
2013-11-02 22:12:39 [SEVERE] Could not pass event PlayerInteractEvent to Ablockalypse v1.3.0
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.SimplePluginManager.fireEvent(SimplePluginManager.java:477)
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462)
at org.bukkit.craftbukkit.v1_6_R2.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:190)
at net.minecraft.server.v1_6_R2.PlayerInteractManager.interact(PlayerInteractManager.java:373)
at net.minecraft.server.v1_6_R2.PlayerConnection.a(PlayerConnection.java:628)
at net.minecraft.server.v1_6_R2.Packet15Place.handle(SourceFile:58)
at net.minecraft.server.v1_6_R2.NetworkManager.b(NetworkManager.java:296)
at net.minecraft.server.v1_6_R2.PlayerConnection.e(PlayerConnection.java:116)
at net.minecraft.server.v1_6_R2.ServerConnection.b(SourceFile:37)
at net.minecraft.server.v1_6_R2.DedicatedServerConnection.b(SourceFile:30)
at net.minecraft.server.v1_6_R2.MinecraftServer.t(MinecraftServer.java:590)
at net.minecraft.server.v1_6_R2.DedicatedServer.t(DedicatedServer.java:226)
at net.minecraft.server.v1_6_R2.MinecraftServer.s(MinecraftServer.java:486)
at net.minecraft.server.v1_6_R2.MinecraftServer.run(MinecraftServer.java:419)
at net.minecraft.server.v1_6_R2.ThreadServerApplication.run(SourceFile:582)
Caused by: java.lang.NullPointerException
at com.github.storage.MapDataStorage.save(MapDataStorage.java:173)
at com.github.event.bukkit.PlayerInteract.PIE(PlayerInteract.java:103)
at sun.reflect.GeneratedMethodAccessor153.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425)
... 16 more
2013-11-02 22:12:41 [SEVERE] Could not pass event PlayerInteractEvent to Ablockalypse v1.3.0
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.SimplePluginManager.fireEvent(SimplePluginManager.java:477)
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462)
at org.bukkit.craftbukkit.v1_6_R2.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:190)
at net.minecraft.server.v1_6_R2.PlayerInteractManager.interact(PlayerInteractManager.java:373)
at net.minecraft.server.v1_6_R2.PlayerConnection.a(PlayerConnection.java:628)
at net.minecraft.server.v1_6_R2.Packet15Place.handle(SourceFile:58)
at net.minecraft.server.v1_6_R2.NetworkManager.b(NetworkManager.java:296)
at net.minecraft.server.v1_6_R2.PlayerConnection.e(PlayerConnection.java:116)
at net.minecraft.server.v1_6_R2.ServerConnection.b(SourceFile:37)
at net.minecraft.server.v1_6_R2.DedicatedServerConnection.b(SourceFile:30)
at net.minecraft.server.v1_6_R2.MinecraftServer.t(MinecraftServer.java:590)
at net.minecraft.server.v1_6_R2.DedicatedServer.t(DedicatedServer.java:226)
at net.minecraft.server.v1_6_R2.MinecraftServer.s(MinecraftServer.java:486)
at net.minecraft.server.v1_6_R2.MinecraftServer.run(MinecraftServer.java:419)
at net.minecraft.server.v1_6_R2.ThreadServerApplication.run(SourceFile:582)
Caused by: java.lang.NullPointerException
at com.github.storage.MapDataStorage.save(MapDataStorage.java:173)
at com.github.event.bukkit.PlayerInteract.PIE(PlayerInteract.java:103)
at sun.reflect.GeneratedMethodAccessor153.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425)
... 16 more
2013-11-02 22:12:41 [WARNING] Can't keep up! Did the system time change, or is the server overloaded?
2013-11-02 22:13:37 [SEVERE] Could not pass event PlayerInteractEvent to Ablockalypse v1.3.0
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.SimplePluginManager.fireEvent(SimplePluginManager.java:477)
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462)
at org.bukkit.craftbukkit.v1_6_R2.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:190)
at net.minecraft.server.v1_6_R2.PlayerInteractManager.interact(PlayerInteractManager.java:373)
at net.minecraft.server.v1_6_R2.PlayerConnection.a(PlayerConnection.java:628)
at net.minecraft.server.v1_6_R2.Packet15Place.handle(SourceFile:58)
at net.minecraft.server.v1_6_R2.NetworkManager.b(NetworkManager.java:296)
at net.minecraft.server.v1_6_R2.PlayerConnection.e(PlayerConnection.java:116)
at net.minecraft.server.v1_6_R2.ServerConnection.b(SourceFile:37)
at net.minecraft.server.v1_6_R2.DedicatedServerConnection.b(SourceFile:30)
at net.minecraft.server.v1_6_R2.MinecraftServer.t(MinecraftServer.java:590)
at net.minecraft.server.v1_6_R2.DedicatedServer.t(DedicatedServer.java:226)
at net.minecraft.server.v1_6_R2.MinecraftServer.s(MinecraftServer.java:486)
at net.minecraft.server.v1_6_R2.MinecraftServer.run(MinecraftServer.java:419)
at net.minecraft.server.v1_6_R2.ThreadServerApplication.run(SourceFile:582)
Caused by: java.lang.OutOfMemoryError: Java heap space
at java.util.HashMap.createEntry(Unknown Source)
at java.util.HashMap.addEntry(Unknown Source)
at java.util.HashMap.put(Unknown Source)
at com.github.storage.MapDataStorage.save(MapDataStorage.java:162)
at com.github.event.bukkit.PlayerInteract.PIE(PlayerInteract.java:103)
at sun.reflect.GeneratedMethodAccessor153.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425)
... 16 more
I think that the 10 or so blocks that were by themselves were simply just not included in the corners I chose so that is why they are unharmed. Please try to find a solution to this because maybe if you do, the map might reappear but I am just hoping for anything now. I do not want to redo 5 hours of work. Until I hear from you, I am leaving my server untouched to prevent further damage. My two thoughts for recovering my map are to either load the saved map with the command or remove the mapdata from the plugin folder but I highly doubt any of these will work. For those reading this, make a backup of your map before you save the map with the command '/za game mapdata (mapName) save'.
I have found the issue, it appears that there was a possible NPE in MapDataStorage. This was likely brought on by a chest that had no items in it, as I was using ((InventoryHolder) state).getInventory(), which can return null if the inventory is empty. I will have this fixed soon and put into an update.
To prevent this issue, simply don't use MapData yet, or put an item in the chest. The update will be out soon enough, and you can save your maps without issue (hopefully).
EDIT: I am not sure you can recover that work, I must say I am sorry. Don't let that stop you from trying though, when the update comes out (basically a patch for the Beta), you can try to reload your data. I would expect the update within the week, although I will post the version with the single patch here.
Patch: https://dl.dropboxusercontent.com/u/93352432/Ablockalypse.jar (301KB, dropbox link)
I'll give it a try tomorrow or whenever I get the free time to do so. I also did not have any items in the chest because I placed it down and that was all I did, nothing more than that.
Yeah, I just had to take a closer look in the code. It turns out InventoryHolder.getInventory() can return null if empty (which is dumb).
Weird, because the blinkers occurred before the crash and even before I tried saving the map.
Did you figure out why the blinkers also appeared abut 60 blocks below the original passage? Also, my passage sizes are okay to use, correct?
The blinkers would probably just be messed up because of the error, that sort of stuff happens sometimes. And yes, passages can be any size you want.
So when you created the map the blinkers were off? I have never had that problem before...
Yup, they were way off the map, but they were where they should be, its just that there were extra blinkers.
Ill record a video or get some screenshots if you would like if I come across it again.