Bug when expanding the island
Expected behavior
After I expand the island with the team, the level is calculated incorrectly. It starts to take into account what was already on the island.
Observed/Actual behavior
When calculating the level after expanding the island, only what the player placed himself would be included
Steps/models to reproduce
- Create a new island
- Calculate the level (it is calculated correctly)
- Expand the island with the command: "range set player value"
- Calculate the level. We get incorrect data
BentoBox version
[14:10:01 INFO]: Запущено PAPER 1.21.5. [14:10:01 INFO]: (1.21.5-2441-5d3463a (MC: 1.21.5)) [14:10:01 INFO]: Версия BentoBox: 3.3.5-SNAPSHOT-b2883 [14:10:01 INFO]: База данных: JSON [14:10:01 INFO]: Загруженные игровые миры: [14:10:01 INFO]: world (world): Верхний мир [14:10:01 INFO]: Активные дополнения: [14:10:01 INFO]: AcidIsland 1.20.1-SNAPSHOT-LOCAL (ENABLED) [14:10:01 INFO]: Biomes 2.2.0 (ENABLED) [14:10:01 INFO]: Border 4.5.1 (ENABLED) [14:10:01 INFO]: Chat 1.3.1-SNAPSHOT-b89 (ENABLED) [14:10:01 INFO]: IslandFly 1.14.2 (ENABLED) [14:10:01 INFO]: Level 2.21.0-SNAPSHOT-b647 (ENABLED) [14:10:01 INFO]: Limits 1.27.0-SNAPSHOT-b362 (ENABLED) [14:10:01 INFO]: Visit 1.7.0-SNAPSHOT (ENABLED)
Plugin list
[14:10:57 INFO]: ℹ Server Plugins (21): [14:10:57 INFO]: Paper Plugins (1): [14:10:57 INFO]: - nightcore [14:10:57 INFO]: Bukkit Plugins (20): [14:10:57 INFO]: - AbstractMenus, BentoBox, BentoBox-AcidIsland, BentoBox-Biomes, BentoBox-Border, BentoBox-Chat, BentoBox-IslandFly, BentoBox-Level, BentoBox-Limits, BentoBox-Visit [14:10:57 INFO]: CoinsEngine, DeluxeMenus, FlectonePulse, InventoryCleaner, ItemsAdder, LuckPerms, PlaceholderAPI, ProtocolLib, SunLight, Vault
Other
No response
I do not understand the problem, sorry. Can you explain more please?
Maybe you can run the level command for the player in the console and capture the full output and share it. Then tell me what is wrong.
When you increase the range, everything should be included.
I apologize for not expressing my thoughts correctly.
I found the problem. The thing is that after the island is expanded, the blocks that are already in the world and for which the cost is indicated in /plugins/BentoBox/addons/Level/blockconfig.yml are included in the calculation
For example, ore. It turns out that after the island is expanded, new blocks appear that are included in the calculation. I have a slightly non-standard world generation and the world does not only consist of sand and water blocks. From here there are two solutions:
-
When generating the world, count blocks not only in the current boundaries, but in the maximum possible boundary for expansion (based on distance-between-islands). But the question is how appropriate this is and it is possible that it will heavily load the server and this will not make sense.
-
Now I just set the value "0" for the blocks that are included in the calculation (/plugins/BentoBox/addons/Level/blockconfig.yml)
The level addon calculates all blocks that are in protected area, regardless if they are placed by player or generated by world. The option to zero island level on start only affects blueprints, if I am not mistaken.
That is kinda intended behavior.
@vtwsu Yes, you're thinking along the right lines. The zeroing is done a few seconds after the island is initially created by pasting the blueprint and like BONNe says, it scans all of the protected area. That level score (I call it a handicap like from golf) is then deducted from any future levels so that the initial score starts at zero. When you increase the size of the island protection zone, all the newly generated blocks do give you that boost, like you found. Unfortunately, scanning the whole potential block area won't work because the user will just end up with a huge negative level.
One workaround is like you said, which is to change the value of generated blocks to 0. This is what the AcidIsland world config does for the most likely blocks (sand and sandstone).
One approach would be to tag blocks made during world generation and ignore them when doing a level scan. Unfortunately, block metadata is not saved with the world, and persistent data container is only used for things like signs, or lecterns. The only approach I can think of is to use minecraft:structure_void instead of air when generating the world. So long as at least one block in a vertical column is minecraft:structure_void the whole column could be ignored. There would need to be a listener for any activity by the user in that x,z coordinate, literally just moving into it, or placing blocks, etc would change all the minecraft:structure_void to minecraft:air and calculate the value of any blocks in that column and add them to the handicap. Depending on the type of world generation, just one minecraft:structure_void would be needed somewhere in the column, e.g., at max height to tag the column.
It's a bit complicated, but could be done maybe. Did you do the world generator yourself?
I have a standard generator, which we modified for ourselves (our own blocks, our own structures, so the difference in levels became noticeable).
If we talk about your solution, the thing is that, for example, my players can freely go beyond their island. It seems that indeed, the right solution is to simply reset the blocks that were used when generating the world (in /plugins/BentoBox/addons/Level/blockconfig.yml).