Fix safelogin for 1.18 and above by using worldProvider minHeight (#4715)

This commit is contained in:
Pierre Dedrie 2021-12-27 00:56:03 +01:00 committed by GitHub
parent 5f98d3fac5
commit 739600eb05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -266,6 +266,7 @@ public final class LocationUtil {
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++;
@ -274,7 +275,8 @@ public final class LocationUtil {
}
}
return y < 0;
// If not then check if player is in the void
return y < ess.getWorldInfoProvider().getMinHeight(world);
}
public static class Vector3D {