From 69b2b4eea89421d3635118a1cc6dce1fc4843619 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Tue, 5 Nov 2019 08:17:10 +0000 Subject: [PATCH] Update CuboidRegion.java --- .../sk89q/worldedit/regions/CuboidRegion.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java index 8c57c96d3..c7c894e3d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java @@ -133,16 +133,14 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion { } pos1 = pos1.clampY(world == null ? Integer.MIN_VALUE : 0, world == null ? Integer.MAX_VALUE : world.getMaxY()); pos2 = pos2.clampY(world == null ? Integer.MIN_VALUE : 0, world == null ? Integer.MAX_VALUE : world.getMaxY()); - BlockVector3 min = getMinimumPoint(); - BlockVector3 max = getMaximumPoint(); - minX = min.getBlockX(); - minY = min.getBlockY(); - minZ = min.getBlockZ(); - maxX = max.getBlockX(); - maxY = max.getBlockY(); - maxZ = max.getBlockZ(); - min = BlockVector3.at(minX, minY, minZ); - max = BlockVector3.at(maxX, maxY, maxZ); + minX = Math.min(pos1.getX(), pos2.getX()); + minY = Math.min(pos1.getY(), pos2.getY()); + minZ = Math.min(pos1.getZ(), pos2.getZ()); + maxX = Math.max(pos1.getX(), pos2.getX()); + maxY = Math.max(pos1.getY(), pos2.getY()); + maxZ = Math.max(pos1.getZ(), pos2.getZ()); + this.min = BlockVector3.at(minX, minY, minZ); + this.max = BlockVector3.at(maxX, maxY, maxZ); } /**