support 1.18 negative y (#1973)

Fixes an issue where blueprint starting block could not be placed in negative area.
This commit is contained in:
evlad 2022-05-01 07:44:42 +02:00 committed by GitHub
parent 3e0368fbab
commit d07c1b5a8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -229,13 +229,13 @@ public class IslandWorldManager {
}
/**
* Value will always be greater than 0 and less than the world's max height.
* Value will always be greater than the world's min height and less than the world's max height.
* @return the islandHeight
*/
public int getIslandHeight(@NonNull World world) {
if (gameModes.containsKey(world) && world.getMaxHeight() > 0) {
return Math.min(world.getMaxHeight() - 1,
Math.max(0, gameModes.get(world).getWorldSettings().getIslandHeight()));
Math.max(world.getMinHeight(), gameModes.get(world).getWorldSettings().getIslandHeight()));
}
return 0;
}