From 23b9b408b4699293badc83e105d325a895ccc007 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Sun, 12 Apr 2015 15:31:17 +1000 Subject: [PATCH] Fix helpers --- .../plot/listeners/worldedit/WEListener.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/worldedit/WEListener.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/worldedit/WEListener.java index 86d14c20d..5f52965d1 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/worldedit/WEListener.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/worldedit/WEListener.java @@ -4,6 +4,7 @@ import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; +import java.util.UUID; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -102,11 +103,14 @@ public class WEListener implements Listener { public HashSet getMask(PlotPlayer player) { HashSet regions = new HashSet<>(); - for (Plot plot : PlotSquared.getPlots(player)) { + UUID uuid = player.getUUID(); + for (Plot plot : PlotSquared.getPlots(player.getLocation().getWorld()).values()) { if (!plot.settings.getMerged(1) && !plot.settings.getMerged(2)) { - Location pos1 = MainUtil.getPlotBottomLoc(plot.world, plot.id).add(1, 0, 1); - Location pos2 = MainUtil.getPlotTopLoc(plot.world, plot.id); - regions.add(new RegionWrapper(pos1.getX(), pos2.getX(), pos1.getZ(), pos2.getZ())); + if (plot.isOwner(uuid) || plot.helpers.contains(uuid)) { + Location pos1 = MainUtil.getPlotBottomLoc(plot.world, plot.id).add(1, 0, 1); + Location pos2 = MainUtil.getPlotTopLoc(plot.world, plot.id); + regions.add(new RegionWrapper(pos1.getX(), pos2.getX(), pos1.getZ(), pos2.getZ())); + } } } return regions;