From f8b1fcffa11b5ffd4ab887d5cd6bc3f22d12d33a Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sat, 12 Nov 2016 00:14:12 +1100 Subject: [PATCH] Fix worldedit mask area --- Core/src/main/java/com/plotsquared/listener/WEManager.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/listener/WEManager.java b/Core/src/main/java/com/plotsquared/listener/WEManager.java index 5d58fb28f..94556d029 100644 --- a/Core/src/main/java/com/plotsquared/listener/WEManager.java +++ b/Core/src/main/java/com/plotsquared/listener/WEManager.java @@ -55,14 +55,17 @@ public class WEManager { plot = player.getMeta("WorldEditRegionPlot"); } if (plot != null && (!Settings.Done.RESTRICT_BUILDING || !Flags.DONE.isSet(plot)) && ((allowMember && plot.isAdded(uuid)) || (!allowMember && (plot.isOwner(uuid)) || plot.getTrusted().contains(uuid)))) { - regions.addAll(plot.getRegions()); + for (RegionWrapper region : plot.getRegions()) { + RegionWrapper copy = new RegionWrapper(region.minX, region.maxX, area.MIN_BUILD_HEIGHT, area.MAX_BUILD_HEIGHT, region.minZ, region.maxZ); + regions.add(copy); + } player.setMeta("WorldEditRegionPlot", plot); } return regions; } public static boolean intersects(RegionWrapper region1, RegionWrapper region2) { - return (region1.minX <= region2.maxX) && (region1.maxX >= region2.minX) && (region1.minZ <= region2.maxZ) && (region1.maxZ >= region2.minZ); + return region1.intersects(region2); } public static boolean regionContains(RegionWrapper selection, HashSet mask) {