diff --git a/randomteleport-plugin/src/main/java/de/themoep/randomteleport/searcher/validators/HeightValidator.java b/randomteleport-plugin/src/main/java/de/themoep/randomteleport/searcher/validators/HeightValidator.java index bb29892..cbcd9be 100644 --- a/randomteleport-plugin/src/main/java/de/themoep/randomteleport/searcher/validators/HeightValidator.java +++ b/randomteleport-plugin/src/main/java/de/themoep/randomteleport/searcher/validators/HeightValidator.java @@ -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(); } }