Skip to content

Commit

Permalink
Fix processHighCraft
Browse files Browse the repository at this point in the history
  • Loading branch information
Intybyte committed Aug 20, 2024
1 parent 7732fdc commit 2d70bb5
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -514,22 +514,22 @@ private void processHighCraft(int minY, int maxY) {
dy = Math.min(dy, -1);
return;
}
final int perWorldMaxHeigh = (int) craftType.getPerWorldProperty(CraftType.PER_WORLD_MAX_HEIGHT_ABOVE_GROUND, world);
final int perWorldMaxHeighAboveGround = (int) craftType.getPerWorldProperty(CraftType.PER_WORLD_MAX_HEIGHT_ABOVE_GROUND, world);
// world == craft.world
if (perWorldMaxHeigh <= world.getMinHeight()) {
if (perWorldMaxHeighAboveGround <= 0) {
return;
}

final MovecraftLocation middle = oldHitBox.getMidPoint();
int testY;

for (testY = minY; testY > world.getMinHeight(); testY--) {
for (testY = minY; testY > 0; testY--) {
if (!craft.getWorld().getBlockAt(middle.getX(), testY - 1, middle.getZ()).getType().isAir()) {
break;
}
}

if (maxY - testY > perWorldMaxHeigh)
if (maxY - testY > perWorldMaxHeighAboveGround)
dy = Math.min(dy, -1);
}

Expand Down

0 comments on commit 2d70bb5

Please sign in to comment.