From e63b436edd9c450dc522115e4128e2154dd7a1c1 Mon Sep 17 00:00:00 2001 From: MattBDev Date: Fri, 6 May 2016 22:03:02 -0400 Subject: [PATCH] Possible build everywhere fix. --- .../plot/util/EventUtil.java | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 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 d81a2a23c..f8bfec7c1 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/util/EventUtil.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/util/EventUtil.java @@ -208,9 +208,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())) { if (Permissions.hasPermission(pp, C.PERMISSION_ADMIN_BUILD_OTHER.s(), notifyPerms)) { return true; } @@ -255,9 +255,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())) { if (Permissions.hasPermission(pp, C.PERMISSION_ADMIN_INTERACT_OTHER.s(), notifyPerms)) { return true; } @@ -281,9 +281,9 @@ public abstract class EventUtil { if (flag.isPresent()) { value = flag.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())) { if (Permissions.hasPermission(pp, C.PERMISSION_ADMIN_INTERACT_OTHER.s(), notifyPerms)) { return true; } @@ -306,9 +306,9 @@ public abstract class EventUtil { if (flag.isPresent()) { value = flag.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())) { if (Permissions.hasPermission(pp, C.PERMISSION_ADMIN_INTERACT_OTHER.s(), notifyPerms)) { return true; } @@ -323,7 +323,6 @@ public abstract class EventUtil { if (!plot.hasOwner()) { return Permissions.hasPermission(pp, C.PERMISSION_ADMIN_INTERACT_UNOWNED.s(), notifyPerms); } - if (plot.getFlag(Flags.MOB_PLACE).or(false)) { return true; } @@ -332,9 +331,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())) { if (Permissions.hasPermission(pp, C.PERMISSION_ADMIN_INTERACT_OTHER.s(), notifyPerms)) { return true; } @@ -351,19 +350,17 @@ public abstract class EventUtil { if (!plot.hasOwner()) { return Permissions.hasPermission(pp, C.PERMISSION_ADMIN_INTERACT_UNOWNED.s(), notifyPerms); } - if (plot.getFlag(Flags.MISC_PLACE).or(false)) { return true; } Optional> flag = plot.getFlag(Flags.PLACE); - HashSet value; if (flag.isPresent()) { value = flag.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())) { if (Permissions.hasPermission(pp, C.PERMISSION_ADMIN_INTERACT_OTHER.s(), notifyPerms)) { return true; } @@ -379,7 +376,6 @@ public abstract class EventUtil { if (!plot.hasOwner()) { return Permissions.hasPermission(pp, C.PERMISSION_ADMIN_INTERACT_UNOWNED.s(), notifyPerms); } - if (plot.getFlag(Flags.VEHICLE_PLACE).or(false)) { return true; } @@ -388,9 +384,9 @@ public abstract class EventUtil { if (flag.isPresent()) { value = flag.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())) { if (Permissions.hasPermission(pp, C.PERMISSION_ADMIN_INTERACT_OTHER.s(), notifyPerms)) { return true; }