From 64f3e8f79bda2eed97c420f1b067dbebedc29ae0 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sun, 15 May 2016 01:54:12 +1000 Subject: [PATCH] Fixes #1116 --- .../intellectualcrafters/plot/util/EventUtil.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Core/src/main/java/com/intellectualcrafters/plot/util/EventUtil.java b/Core/src/main/java/com/intellectualcrafters/plot/util/EventUtil.java index 0daac16ea..dae7611e8 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/util/EventUtil.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/util/EventUtil.java @@ -188,9 +188,9 @@ public abstract class EventUtil { if (flagValue.isPresent()) { value = flagValue.get(); } else { - return true; + value = null; } - if (!value.contains(PlotBlock.EVERYTHING) && !value.contains(block.getPlotBlock())) { + if (value == null || !value.contains(PlotBlock.EVERYTHING) && !value.contains(block.getPlotBlock())) { return Permissions.hasPermission(pp, C.PERMISSION_ADMIN_INTERACT_OTHER.s(), notifyPerms) || !(!notifyPerms || MainUtil .sendMessage(pp, C.FLAG_TUTORIAL_USAGE, C.FLAG_USE.s())); } @@ -233,10 +233,13 @@ public abstract class EventUtil { if (flagValue.isPresent()) { value = flagValue.get(); } else { - return true; + value = null; } - if (!value.contains(PlotBlock.EVERYTHING) && !value.contains(block.getPlotBlock())) { - return true; //!(!false || MainUtil.sendMessage(pp, C.FLAG_TUTORIAL_USAGE, C.FLAG_USE.s() + "/" + C.FLAG_DEVICE_INTERACT.s())); + if (value == null || !value.contains(PlotBlock.EVERYTHING) && !value.contains(block.getPlotBlock())) { + if (Permissions.hasPermission(pp, C.PERMISSION_ADMIN_BUILD_OTHER.s(), false)) { + return true; + } + return false; } return true; } @@ -275,7 +278,6 @@ public abstract class EventUtil { if (plot.getFlag(Flags.MISC_INTERACT).or(false)) { return true; } - Optional> flag = plot.getFlag(Flags.USE); HashSet value; if (flag.isPresent()) {