diff --git a/Movecraft/src/main/java/net/countercraft/movecraft/async/translation/TranslationTask.java b/Movecraft/src/main/java/net/countercraft/movecraft/async/translation/TranslationTask.java index a1a9390b6..f9759b0e3 100644 --- a/Movecraft/src/main/java/net/countercraft/movecraft/async/translation/TranslationTask.java +++ b/Movecraft/src/main/java/net/countercraft/movecraft/async/translation/TranslationTask.java @@ -229,13 +229,15 @@ protected void execute() throws InterruptedException, ExecutionException { MovecraftLocation test = new MovecraftLocation(newHitBox.getMidPoint().getX(), newHitBox.getMinY(), newHitBox.getMidPoint().getZ()); test = test.translate(0, -1, 0); - while (test.toBukkit(world).getBlock().getType().isAir()) { + // If we are out of bounds, that is technically air, but then we would have an infinite loop, so stay in Y bounds + while (test.toBukkit(world).getBlock().getType().isAir() && world.getMinHeight() >= test.getY()) { test = test.translate(0, -1, 0); } Material testType = test.toBukkit(world).getBlock().getType(); if (craft.getType().getMaterialSetProperty(CraftType.FORBIDDEN_HOVER_OVER_BLOCKS).contains(testType)) { fail(String.format(I18nSupport.getInternationalisedString("Translation - Failed Craft over block"), testType.name().toLowerCase().replace("_", " "))); + return; } } //call event