From 6d59e79e784fb9e44d3ba07021354b49aaac15be Mon Sep 17 00:00:00 2001 From: BONNe Date: Fri, 18 Mar 2022 15:06:31 +0200 Subject: [PATCH] Fixes bug with Safe Spot Teleport (#1951) There was a bug that prevented finding a safe spot if all valid blocks were in height with the `startY` location. Reported via discord. --- .../world/bentobox/bentobox/util/teleport/SafeSpotTeleport.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/world/bentobox/bentobox/util/teleport/SafeSpotTeleport.java b/src/main/java/world/bentobox/bentobox/util/teleport/SafeSpotTeleport.java index a413010e5..370d1cf4a 100644 --- a/src/main/java/world/bentobox/bentobox/util/teleport/SafeSpotTeleport.java +++ b/src/main/java/world/bentobox/bentobox/util/teleport/SafeSpotTeleport.java @@ -226,7 +226,7 @@ public class SafeSpotTeleport { // Check the safe spot at the current height for (int x = 0; x < 16; x++) { for (int z = 0; z < 16; z++) { - if (minY >= startY && checkBlock(chunk, x, startY, z)) { + if (minY <= startY && checkBlock(chunk, x, startY, z)) { return true; } maxY = Math.max(chunk.getHighestBlockYAt(x, z), maxY);