ItemJoin

ItemJoin

157k Downloads

Chest inventory wipes after server restart if opened.

mibby opened this issue ยท 6 comments

commented

Paper dev 264
ItemJoin dev 401

If you have a chest opened and restart the server (stop in console), when you start the server up again your chest contents will be wiped. I narrowed down this issue being a problem with ItemJoins wiping chests. When I remove ItemJoins, chests no longer wipe when opened during server shutdown.

This also occurs with dev 403. As well as occurs with public release build v5.0.6.

commented

This bug has been officially fixed in the release of ItemJoin v5.0.7.
You can grab it here; Download: https://www.spigotmc.org/resources/itemjoin.12661/download?version=354306

Please read the changelog as the documentation has not been updated yet;
https://github.com/RockinChaos/ItemJoin/wiki/Recent-Changes

commented

@RockinChaos This bug does not occur with release v5.0.5. So the issue lies somewhere between Sep 26th 2019 to Mar 26th 2020. :( Pretty severe since it wipes legitimate items from users.

commented

Not present in dev 384, present in dev 387.

384 has this error on login, but it's better than chests wiping.

[23:33:24] [Server thread/WARN]: [ItemJoin] Task #5 for ItemJoin v5.0.6-SNAPSHOT-b384 generated an exception
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.ArrayList.rangeCheck(ArrayList.java:653) ~[?:1.8.0_51]
	at java.util.ArrayList.get(ArrayList.java:429) ~[?:1.8.0_51]
	at me.RockinChaos.itemjoin.giveitems.utils.ItemMap.setJSONBookPages(ItemMap.java:1706) ~[?:?]
	at me.RockinChaos.itemjoin.giveitems.utils.ItemMap.updateItem(ItemMap.java:1644) ~[?:?]
	at me.RockinChaos.itemjoin.giveitems.utils.ItemMap.giveTo(ItemMap.java:1987) ~[?:?]
	at me.RockinChaos.itemjoin.giveitems.listeners.PlayerJoin.runTask(PlayerJoin.java:60) ~[?:?]
	at me.RockinChaos.itemjoin.giveitems.listeners.PlayerJoin.access$100(PlayerJoin.java:18) ~[?:?]
	at me.RockinChaos.itemjoin.giveitems.listeners.PlayerJoin$2.run(PlayerJoin.java:45) ~[?:?]
	at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftTask.run(CraftTask.java:84) ~[patched_1.15.2.jar:git-Paper-264]
	at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:461) ~[patched_1.15.2.jar:git-Paper-264]
	at net.minecraft.server.v1_15_R1.MinecraftServer.b(MinecraftServer.java:1252) ~[patched_1.15.2.jar:git-Paper-264]
	at net.minecraft.server.v1_15_R1.DedicatedServer.b(DedicatedServer.java:430) ~[patched_1.15.2.jar:git-Paper-264]
	at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:1169) ~[patched_1.15.2.jar:git-Paper-264]
	at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:958) ~[patched_1.15.2.jar:git-Paper-264]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_51]
commented

Yeah, this has to do with the JSON Book rewrite that occurred in v5.0.6.

I think I already resolved this but I can't have you test it as I am working on some major rewrite / cleanup of ItemJoins core code over this past month. In the next day or two, you should see a massive commit followed by some of the open issues disappearing so I will set this as bug testing so that once I push this large commit I can try to replicate the issue on the latest dev build.

If you decide to test the pushed dev build that is coming before I respond to this issue, be warned that it may contain a lot of bugs (nothing game breaking, just plugin breaking).

commented

Chests didn't wipe when re-testing. Seems to be confirmed fixed with dev 411!

Not sure if you want this ticket on hold until it's no longer a pending release, so I'll let you decide whether or not to close it. :)

commented

Okay so, In the latest snapshot I have fixed the removal of chest contents. It looks like it had to do with some fixes I was doing to crafting items (even if you didn't use crafting items). It was saving the chest contents to the database.db and removing them from in-game because it thought the player had their inventory closed--and players are not allowed to logout with any crafting items in the inventory, thus it was set to resolve that.

As for the JSON Book error, this should also be resolved.

Snapshot; http://ci.craftationgaming.com/job/ItemJoin/411/

Sorry about the issues, let me know if there are any more problems!