From 5de4cfced2b24e223a833035454b38d72039a3c0 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 13 Sep 2016 09:26:23 +0200 Subject: [PATCH] Fix region contain method The region contain method was broken. A lot of subsquent issues are caused by this bug. E.g. in a selection the entities in the last blocks at the positive-axis border are not selected. Max block gives the impression of an exclusive point; however it is inclusive! A position that is anywhere between of a 1x1x1 region, would return false in the old implementation. By simply adding a one this should solve the problem. Greetings --- .../main/java/com/sk89q/worldedit/regions/CuboidRegion.java | 6 +++--- 1 file changed, 3 insertions(+), 3 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 258be2c6f..cf0a93503 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 @@ -336,9 +336,9 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion { Vector min = getMinimumPoint(); Vector max = getMaximumPoint(); - return x >= min.getBlockX() && x <= max.getBlockX() - && y >= min.getBlockY() && y <= max.getBlockY() - && z >= min.getBlockZ() && z <= max.getBlockZ(); + return x >= min.getBlockX() && x < max.getBlockX() + 1 + && y >= min.getBlockY() && y < max.getBlockY() + 1 + && z >= min.getBlockZ() && z < max.getBlockZ() + 1; } @Override