BG-Software-LLC / SuperiorSkyblock2

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

The island level decreases when you type the /is level command #2203

Open empiremcnetwork opened 4 weeks ago

empiremcnetwork commented 4 weeks ago

Minecraft's Version

1.20.4

Plugin's Version

SuperiorSkyblock2-2024.2-b300.jar

Describe the bug

If the player uses the /is level command away from the valuable blocks that give the island level, the island level will be halved, and even if the player goes to the blocks and uses the /is level command, that level will not be restored.

To Reproduce

Stack the valuable blocks, move away from the island or do not be on the island. Use the /is level command and your island level will be halved.

Additional Information

This bug has been around since May 2024, this bug is not in the development builds of late March and first week of April. If the player uses the /is level command away from the island, the island level is halved.

empiremcnetwork commented 4 weeks ago

Let me give you some more information: My server crashed momentarily due to the PinataParty plugin and I had to close it with CTRL + C. After I turned the server back on, the island level of the players had dropped by half. After that incident, this started to happen, even if the player's level was full, after 1-2 days /is Even if he uses the level command or not, it drops by half again. I think it only happens to some players, it does not count the stacked blocks exactly.

OmerBenGera commented 4 weeks ago

/is level goes through all the "dirty chunks" (dirty chunks are chunks that the plugin knows contain blocks in them) and read their blocks, then calculate the amount of each block (even for non-loaded chunks)

If it doesnt work as intended, make sure the chunk is dirty - you can do so by placing a block inside it, then check if it changed anything.

You can also use the /is admin debug command, it can show you the chunks that were calculated

empiremcnetwork commented 3 weeks ago

Every time I close and open the server, my players' island levels drop by half, I tried the debug thing you said but it's not a solution. There is no such problem in the March-April SuperiorSkyblock2 version, these problems started at the end of April. Every time I close and open the server, my players' island levels drop continuously, maybe the code you wrote doesn't count the blocks in the chunks, you can see how many blocks there are but it doesn't work on the island level, the stacking block setting is on, as I said, the plugin doesn't count the stacked blocks properly every time I close and open the server.

OmerBenGera commented 3 weeks ago

When the server stops, the plugin saves the block counts to DB, not the worth or level. Then, when the server starts up, it calculates the worth and level from the block counts that were saved. It does not recalculate the block counts again. Also, you mentioned in the title of the bug report that it happens when running /is level, however now you mention it happens when restarting - I need to know exactly how and when it occurs.

Are you able to replicate the issue on a server with only SSB installed, default config files?