Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down