From d091d6902cb28c3625e963284ab23ce1f0c87f3f Mon Sep 17 00:00:00 2001 From: Josh Roy <10731363+JRoy@users.noreply.github.com> Date: Fri, 3 Dec 2021 15:31:36 -0500 Subject: [PATCH] Fix safelogin support with 1.18 world heights (#4667) Fixes #4665. --- .../main/java/com/earth2me/essentials/utils/LocationUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/main/java/com/earth2me/essentials/utils/LocationUtil.java b/Essentials/src/main/java/com/earth2me/essentials/utils/LocationUtil.java index 1a9b5c5f7..f25d6277e 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/utils/LocationUtil.java +++ b/Essentials/src/main/java/com/earth2me/essentials/utils/LocationUtil.java @@ -267,7 +267,7 @@ public final class LocationUtil { int y = (int) Math.round(loc.getY()); final int z = loc.getBlockZ(); int count = 0; - while (LocationUtil.isBlockUnsafe(ess, world, x, y, z) && y > -1) { + while (LocationUtil.isBlockUnsafe(ess, world, x, y, z) && y >= ess.getWorldInfoProvider().getMinHeight(world)) { y--; count++; if (count > 2) {