From ea1d4416d859dbe55f7b403ea87436477cecbe03 Mon Sep 17 00:00:00 2001 From: Josh Roy <10731363+JRoy@users.noreply.github.com> Date: Fri, 3 Dec 2021 15:22:31 -0500 Subject: [PATCH] Fix essentials.fly.safelogin compatability with 1.18 world height --- .../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 1a9b5c5f732..f25d6277e63 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 static boolean shouldFly(IEssentials ess, final Location loc) { 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) {