From 2806f8b20c947222c0cf313f9323512bf944e491 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Fri, 26 Aug 2016 01:36:35 +1000 Subject: [PATCH] Fixes #1307 --- .../java/com/plotsquared/listener/WEManager.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/listener/WEManager.java b/Core/src/main/java/com/plotsquared/listener/WEManager.java index 99f5eae3f..5d58fb28f 100644 --- a/Core/src/main/java/com/plotsquared/listener/WEManager.java +++ b/Core/src/main/java/com/plotsquared/listener/WEManager.java @@ -49,13 +49,14 @@ public class WEManager { return regions; } boolean allowMember = player.hasPermission("plots.worldedit.member"); - for (Plot plot : area.getPlots()) { - if (!plot.isBasePlot() || (Settings.Done.RESTRICT_BUILDING && (plot.getFlag(Flags.DONE).isPresent()))) { - continue; - } - if (allowMember && plot.isAdded(uuid) || !allowMember && (plot.isOwner(uuid) || plot.getTrusted().contains(uuid))) { - regions.addAll(plot.getRegions()); - } + Plot plot = player.getCurrentPlot(); + HashSet allowed = new HashSet<>(); + if (plot == null) { + 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()); + player.setMeta("WorldEditRegionPlot", plot); } return regions; }