From 415c6fb0d49055a0cc59dda86b537ffeb3125475 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sun, 31 Jul 2016 18:14:06 +1000 Subject: [PATCH 1/2] Fixes #1283 --- .../com/plotsquared/bukkit/listeners/PlayerEvents.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java index 2f673a3b8..e973be1e7 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java @@ -951,12 +951,12 @@ public class PlayerEvents extends PlotListener implements Listener { } List blocks = event.getBlocks(); for (Block b : blocks) { - Location bloc = BukkitUtil.getLocation(b.getLocation().add(relative)); - if (!area.contains(bloc.getX(), bloc.getZ())) { + Location bloc = BukkitUtil.getLocation(b.getLocation()); + if (!area.contains(bloc.getX(), bloc.getZ()) || !area.contains(bloc.getX() + relative.getBlockX(), bloc.getZ() + relative.getBlockZ())) { event.setCancelled(true); return; } - if (!plot.equals(area.getOwnedPlot(bloc))) { + if (!plot.equals(area.getOwnedPlot(bloc)) || !plot.equals(area.getOwnedPlot(bloc.add(relative.getBlockX(), relative.getBlockY(), relative.getBlockZ())))) { event.setCancelled(true); return; } @@ -1671,7 +1671,7 @@ public class PlayerEvents extends PlotListener implements Listener { return; } } else if (lastPlot != null && now.equals(lastPlot)) { - if (!Flags.DENY_TELEPORT.allowsTeleport(pp, lastPlot)) { + if (!Flags.TELEPORT_DENY.allowsTeleport(pp, lastPlot)) { event.setTo(BukkitUtil.getLocation(lastPlot.getSide())); } return; @@ -1744,7 +1744,7 @@ public class PlayerEvents extends PlotListener implements Listener { return; } } else if (lastPlot != null && now.equals(lastPlot)) { - if (!Flags.DENY_TELEPORT.allowsTeleport(pp, lastPlot)) { + if (!Flags.TELEPORT_DENY.allowsTeleport(pp, lastPlot)) { event.setTo(BukkitUtil.getLocation(lastPlot.getSide())); } return; From a13b9fb31bc9a9a8c9e31ed40d39a9a7bd2d4db5 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Mon, 1 Aug 2016 11:20:06 +1000 Subject: [PATCH 2/2] flag tix --- .../java/com/plotsquared/bukkit/listeners/PlayerEvents.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java index 1a2bcbba5..0b6af19f1 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java @@ -1673,7 +1673,7 @@ public class PlayerEvents extends PlotListener implements Listener { return; } } else if (lastPlot != null && now.equals(lastPlot)) { - if (!Flags.TELEPORT_DENY.allowsTeleport(pp, lastPlot)) { + if (!Flags.DENY_TELEPORT.allowsTeleport(pp, lastPlot)) { event.setTo(BukkitUtil.getLocation(lastPlot.getSide())); } return; @@ -1746,7 +1746,7 @@ public class PlayerEvents extends PlotListener implements Listener { return; } } else if (lastPlot != null && now.equals(lastPlot)) { - if (!Flags.TELEPORT_DENY.allowsTeleport(pp, lastPlot)) { + if (!Flags.DENY_TELEPORT.allowsTeleport(pp, lastPlot)) { event.setTo(BukkitUtil.getLocation(lastPlot.getSide())); } return;