From e2d3150fa2db5158ddbdc434f6f1f6bff76a23d7 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sun, 27 Sep 2020 17:29:13 -0700 Subject: [PATCH] getHighestBlockYAt() does not detect heads so check full height of world Fixes https://github.com/BentoBoxWorld/Level/issues/193 --- .../world/bentobox/level/calculators/IslandLevelCalculator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/world/bentobox/level/calculators/IslandLevelCalculator.java b/src/main/java/world/bentobox/level/calculators/IslandLevelCalculator.java index a618fd3..34411ba 100644 --- a/src/main/java/world/bentobox/level/calculators/IslandLevelCalculator.java +++ b/src/main/java/world/bentobox/level/calculators/IslandLevelCalculator.java @@ -377,7 +377,7 @@ public class IslandLevelCalculator { continue; } // Only count to the highest block in the world for some optimization - for (int y = 0; y < chunkSnapshot.getHighestBlockYAt(x, z); y++) { + for (int y = 0; y < chunk.getWorld().getMaxHeight(); y++) { BlockData blockData = chunkSnapshot.getBlockData(x, y, z); int seaHeight = addon.getPlugin().getIWM().getSeaHeight(island.getWorld()); boolean belowSeaLevel = seaHeight > 0 && y <= seaHeight;