From 411c75b2197094fe4183bbfbcb3e9f626f12e200 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Tue, 14 Mar 2017 01:56:14 +1100 Subject: [PATCH] Fixes #1556 Close #1555 --- .../sponge/listener/MainListener.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Sponge/src/main/java/com/plotsquared/sponge/listener/MainListener.java b/Sponge/src/main/java/com/plotsquared/sponge/listener/MainListener.java index 5c0d690af..11fb5a9a8 100644 --- a/Sponge/src/main/java/com/plotsquared/sponge/listener/MainListener.java +++ b/Sponge/src/main/java/com/plotsquared/sponge/listener/MainListener.java @@ -517,28 +517,28 @@ public class MainListener { if (plot == null) { if (!Permissions.hasPermission(pp, C.PERMISSION_ADMIN_BUILD_ROAD, true)) { event.setCancelled(true); - return; } - if (plot.hasOwner()) { - if (plot.isAdded(pp.getUUID()) || Permissions.hasPermission(pp, C.PERMISSION_ADMIN_BUILD_OTHER)) { - return; - } else { - com.google.common.base.Optional> place = plot.getFlag(Flags.PLACE); - BlockState state = first.getBlock(); - if (!place.isPresent() || !place.get().contains(SpongeUtil.getPlotBlock(state))) { - MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_BUILD_OTHER); - event.setCancelled(true); - return; - } - } + return; + } + if (plot.hasOwner()) { + if (plot.isAdded(pp.getUUID()) || Permissions.hasPermission(pp, C.PERMISSION_ADMIN_BUILD_OTHER)) { + return; } else { - if (Permissions.hasPermission(pp, C.PERMISSION_ADMIN_BUILD_UNOWNED)) { + com.google.common.base.Optional> place = plot.getFlag(Flags.PLACE); + BlockState state = first.getBlock(); + if (!place.isPresent() || !place.get().contains(SpongeUtil.getPlotBlock(state))) { + MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_BUILD_OTHER); + event.setCancelled(true); return; } - MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_BUILD_UNOWNED); - event.setCancelled(true); + } + } else { + if (Permissions.hasPermission(pp, C.PERMISSION_ADMIN_BUILD_UNOWNED)) { return; } + MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_BUILD_UNOWNED); + event.setCancelled(true); + return; } }