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.
This commit is contained in:
BONNe 2022-03-18 15:06:31 +02:00 committed by GitHub
parent 0cf1d43a29
commit 6d59e79e78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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);