BG-Software-LLC / SuperiorSkyblock2

Optimized, feature packed Skyblock core.
https://bg-software.com/superiorskyblock/
GNU General Public License v3.0
171 stars 148 forks source link

Stacked blocks are not saved on server shutdown #2231

Closed Kapitowa closed 2 months ago

Kapitowa commented 2 months ago

Minecraft's Version

This server is running Paper version 1.21.1-77-master@4ff58c4 (2024-09-12T18:05:09Z) (Implementing API version 1.21.1-R0.1-SNAPSHOT)

Plugin's Version

SuperiorSkyBlock 2024.3 (latest stable build)

Describe the bug

Stacked blocks doesn't save on server stop.

To Reproduce

Idk, it happens randomly on server close. Seems SuperiorSkyBlock sometimes changing stacked blocks data on server stop, when saving database

Additional Information

log from console

[05:20:21] [Server thread/INFO]: [SuperiorSkyblock2] Disabling SuperiorSkyblock2 v2024.3
[05:20:21] [Server thread/ERROR]: [SuperiorSkyblock2] An unexpected error occurred while disabling the plugin:
[05:20:21] [Server thread/WARN]: java.util.NoSuchElementException
[05:20:21] [Server thread/WARN]:    at it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap$MapIterator.nextEntry(Int2ObjectLinkedOpenHashMap.java:1181)
[05:20:21] [Server thread/WARN]:    at it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap$EntryIterator.next(Int2ObjectLinkedOpenHashMap.java:1293)
[05:20:21] [Server thread/WARN]:    at it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap$EntryIterator.next(Int2ObjectLinkedOpenHashMap.java:1275)
[05:20:21] [Server thread/WARN]:    at SuperiorSkyblock2-2024.3.jar//com.bgsoftware.superiorskyblock.core.collections.creator.FastUtilCollectionsCreator$Int2ObjectFastUtilMapView$EntryIteratorWrapper.next(FastUtilCollectionsCreator.java:138)
[05:20:21] [Server thread/WARN]:    at SuperiorSkyblock2-2024.3.jar//com.bgsoftware.superiorskyblock.core.collections.creator.FastUtilCollectionsCreator$Int2ObjectFastUtilMapView$EntryIteratorWrapper.next(FastUtilCollectionsCreator.java:123)
[05:20:21] [Server thread/WARN]:    at SuperiorSkyblock2-2024.3.jar//com.bgsoftware.superiorskyblock.core.collections.Location2ObjectMap$Itr.next(Location2ObjectMap.java:467)
[05:20:21] [Server thread/WARN]:    at java.base/java.lang.Iterable.forEach(Iterable.java:74)
[05:20:21] [Server thread/WARN]:    at SuperiorSkyblock2-2024.3.jar//com.bgsoftware.superiorskyblock.core.stackedblocks.container.DefaultStackedBlocksContainer.forEach(DefaultStackedBlocksContainer.java:45)
[05:20:21] [Server thread/WARN]:    at SuperiorSkyblock2-2024.3.jar//com.bgsoftware.superiorskyblock.core.stackedblocks.StackedBlocksManagerImpl.saveStackedBlocks(StackedBlocksManagerImpl.java:261)
[05:20:21] [Server thread/WARN]:    at SuperiorSkyblock2-2024.3.jar//com.bgsoftware.superiorskyblock.SuperiorSkyblockPlugin.onDisable(SuperiorSkyblockPlugin.java:340)
[05:20:21] [Server thread/WARN]:    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:291)
[05:20:21] [Server thread/WARN]:    at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.disablePlugin(PaperPluginInstanceManager.java:241)
[05:20:21] [Server thread/WARN]:    at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.disablePlugins(PaperPluginInstanceManager.java:162)
[05:20:21] [Server thread/WARN]:    at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.disablePlugins(PaperPluginManagerImpl.java:97)
[05:20:21] [Server thread/WARN]:    at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:541)
[05:20:21] [Server thread/WARN]:    at org.bukkit.craftbukkit.CraftServer.disablePlugins(CraftServer.java:612)
[05:20:21] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.stopServer(MinecraftServer.java:1052)
[05:20:21] [Server thread/WARN]:    at net.minecraft.server.dedicated.DedicatedServer.stopServer(DedicatedServer.java:863)
[05:20:21] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.close(MinecraftServer.java:1015)
[05:20:21] [Server thread/WARN]:    at org.spigotmc.RestartCommand.shutdownServer(RestartCommand.java:92)
[05:20:21] [Server thread/WARN]:    at org.spigotmc.RestartCommand.restart(RestartCommand.java:61)
[05:20:21] [Server thread/WARN]:    at org.spigotmc.RestartCommand.restart(RestartCommand.java:41)
[05:20:21] [Server thread/WARN]:    at org.spigotmc.RestartCommand$1.run(RestartCommand.java:32)
[05:20:21] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1766)
[05:20:21] [Server thread/WARN]:    at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:489)
[05:20:21] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1612)
[05:20:21] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1312)
[05:20:21] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:335)
[05:20:21] [Server thread/WARN]:    at java.base/java.lang.Thread.run(Thread.java:1583)
[05:20:21] [Server thread/INFO]: [SuperiorSkyblock2] Shutting down calculation task...
[05:20:21] [Server thread/INFO]: [SuperiorSkyblock2] Shutting down executor
[05:20:21] [Server thread/INFO]: [SuperiorSkyblock2] Shutting down database executor
[05:20:25] [Server thread/INFO]: [SuperiorSkyblock2] Closing database. This may hang the server. Do not shut it down, or data may get lost.
OmerBenGera commented 2 months ago

Do you know how to replicate the issue? Does it happen all the time for you? Do you have any modules installed (especially SlimeWorldsModule)?

Kapitowa commented 2 months ago

I found how to replicate the issue. This exception throw on server shutdown, when someone delete island (by /is disband) with stacked blocks. Seems SuperiorSkyBlock iterates on locations of deleted islands for stacked blocks and catch Exception. All subsequent stacked blocks after this exception not saved.

I use only this modules: bank and upgrades.

OmerBenGera commented 2 months ago

Check out latest dev build, should be fixed

Kapitowa commented 2 months ago

Problem is fixed