Limit blueprint pasting to world y coords. Addresses #2334

This commit is contained in:
tastybento 2024-03-28 21:58:01 -07:00
parent ea8562f351
commit 1bce4ec1b9
1 changed files with 3 additions and 0 deletions

View File

@ -119,6 +119,9 @@ public class BlueprintPaster {
Vector off = bp.getBedrock() != null ? bp.getBedrock() : new Vector(0,0,0);
// Calculate location for pasting
this.location = island.getProtectionCenter().toVector().subtract(off).toLocation(world);
// Ensure the y coordinate is within the world limits
int y = Math.min(world.getMaxHeight() - 1, Math.max(world.getMinHeight(), location.getBlockY()));
location.setY(y);
}
private record Bits(Map<Vector, BlueprintBlock> blocks,