Wrong min height (Y axis) for level calculation since 1.18
Pirgosth opened this issue · 1 comments
Expected behavior
When performing /is level
, we expect the addon to calculate the island level for blocks (and so chunks) that are in the player island area. That's for x and z coordinates, but also for y axis (between -64 and the highest block).
Observed/Actual behavior
But all blocks below Y=0 are not count as part of the island anymore because of the new breaking bottom limit of blocks in 1.18 update. This results in island having low levels even if they have a lot of blocs below Y=0.
Steps/models to reproduce
Just create a new island and move all blocs bellow Y=0, it will result in the island level to decrease.
BentoBox version
[22:23:43] [Server thread/INFO]: Running SPIGOT 1.18.1.
[22:23:43] [Server thread/INFO]: BentoBox version: 1.19.0
[22:23:43] [Server thread/INFO]: Database: JSON
[22:23:43] [Server thread/INFO]: Loaded Game Worlds:
[22:23:43] [Server thread/INFO]: bskyblock_world (BSkyBlock): Overworld, Nether, The End
[22:23:43] [Server thread/INFO]: Loaded Addons:
[22:23:43] [Server thread/INFO]: Biomes 1.14.0 (ENABLED)
[22:23:43] [Server thread/INFO]: BSkyBlock 1.15.2 (ENABLED)
[22:23:43] [Server thread/INFO]: Challenges 0.8.4 (ENABLED)
[22:23:43] [Server thread/INFO]: ControlPanel 1.13.0 (ENABLED)
[22:23:43] [Server thread/INFO]: DimensionalTrees 1.6.0 (ENABLED)
[22:23:43] [Server thread/INFO]: Level 2.8.1 (ENABLED)
[22:23:43] [Server thread/INFO]: Limits 1.17.2 (ENABLED)
[22:23:43] [Server thread/INFO]: Warps 1.11.1 (ENABLED)
Plugin list
[22:24:54] [Server thread/INFO]: Plugins (7): Vault, Essentials, BentoBox
Other
I suggest editing the IslandLevelCalculator, more precisely the private void scanAsync(Chunk chunk)
function in order to change the y loop from lowest chunk block, as you already do for the chunk uppermost block. This way, there will no more have an hardcoded value for Y axis, it will be cross version (it will still work for previous versions with minY = 0) and it will even optimize things a bit as you will not iterate over blocks below the lowest one.