From ee804a81485a1c28016891c13ca503585326d5d7 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Fri, 23 Jan 2015 18:17:53 -0700 Subject: [PATCH] should fix #106 (testing needed) --- .../plot/listeners/PlayerEvents.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java index e0614a501..6a2d381a5 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java @@ -170,16 +170,20 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi return; } } - if (enteredPlot(f, q)) { - final Plot plot = getCurrentPlot(q); - final boolean admin = PlotMain.hasPermission(player, "plots.admin.entry.denied"); - if (plot.deny_entry(player) && !admin) { - event.setCancelled(true); + Plot plot = getCurrentPlot(q); + if (plot != null) { + if (!plot.equals(getCurrentPlot(f))) { + event.setCancelled(true); return; - } - plotEntry(player, plot); + } + if (plot.deny_entry(player)) { + if (!PlotMain.hasPermission(player, "plots.admin.entry.denied")) { + event.setCancelled(true); + return; + } + } } else if (leftPlot(f, q)) { - final Plot plot = getCurrentPlot(event.getFrom()); + plot = getCurrentPlot(event.getFrom()); plotExit(player, plot); } }