Check for passable and liquids instead of just solids (Fixes #44)

This commit is contained in:
Phoenix616 2021-03-09 14:28:25 +01:00
parent 9dfc62f9f5
commit 8e0643e59c
No known key found for this signature in database
GPG Key ID: 40E2321E71738EB0
1 changed files with 5 additions and 1 deletions

View File

@ -46,6 +46,10 @@ public class HeightValidator extends LocationValidator {
}
}
location.setY(block.getY());
return !block.getRelative(BlockFace.UP).getType().isSolid() && !block.getRelative(BlockFace.UP, 2).getType().isSolid();
return isSafe(block.getRelative(BlockFace.UP)) && isSafe(block.getRelative(BlockFace.UP, 2));
}
private static boolean isSafe(Block block) {
return block.isPassable() && !block.isLiquid();
}
}