Skip to content

Commit

Permalink
Fix safelogin for 1.18 and above by using worldProvider minHeight (#4715
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Pirgosth authored Dec 26, 2021
1 parent 5f98d3f commit 739600e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,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;
// Check whether more than 2 unsafe block are below player.
while (LocationUtil.isBlockUnsafe(ess, world, x, y, z) && y >= ess.getWorldInfoProvider().getMinHeight(world)) {
y--;
count++;
Expand All @@ -274,7 +275,8 @@ public static boolean shouldFly(IEssentials ess, final Location loc) {
}
}

return y < 0;
// If not then check if player is in the void
return y < ess.getWorldInfoProvider().getMinHeight(world);
}

public static class Vector3D {
Expand Down

0 comments on commit 739600e

Please sign in to comment.