diff --git a/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java b/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java index 19e257ca1..f4af19420 100644 --- a/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java +++ b/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java @@ -925,8 +925,9 @@ public class MainUtil { final String world = plot.world; final PlotManager manager = PS.get().getPlotManager(world); final PlotWorld plotworld = PS.get().getPlotWorld(world); - final Location bot = manager.getPlotBottomLocAbs(plotworld, plot.id); - final Location top = manager.getPlotTopLocAbs(plotworld, plot.id); + PlotId id = new PlotId(Math.abs(plot.id.x) + 1, Math.abs(plot.id.x) + 1); + final Location bot = manager.getPlotBottomLocAbs(plotworld, id); + final Location top = manager.getPlotTopLocAbs(plotworld, id); final int border = worldBorder.get(plot.world); final int botmax = Math.max(Math.abs(bot.getX()), Math.abs(bot.getZ())); final int topmax = Math.max(Math.abs(top.getX()), Math.abs(top.getZ())); diff --git a/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java b/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java index 6979c2532..86e4da1ad 100644 --- a/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java @@ -505,10 +505,7 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen PlotId id = plotManager.getPlotId(plotworld, x2, 0, getInt(to.getZ())); Plot lastPlot = (Plot) pp.getMeta("lastplot"); if (id == null) { - if (lastPlot == null) { - return; - } - if (!plotExit(pp, lastPlot)) { + if (lastPlot != null && !plotExit(pp, lastPlot)) { MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, PERMISSION_ADMIN_EXIT_DENIED); if (lastPlot.equals(MainUtil.getPlot(BukkitUtil.getLocation(from)))) { player.teleport(from); @@ -521,7 +518,7 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen } } else if (lastPlot != null && id.equals(lastPlot.id)) { - return; + return; } else { Plot plot = MainUtil.getPlot(worldname, id); @@ -571,10 +568,7 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen PlotId id = plotManager.getPlotId(plotworld, x2, 0, z2); Plot lastPlot = (Plot) pp.getMeta("lastplot"); if (id == null) { - if (lastPlot == null) { - return; - } - if (!plotExit(pp, lastPlot)) { + if (lastPlot != null && !plotExit(pp, lastPlot)) { MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, PERMISSION_ADMIN_EXIT_DENIED); if (lastPlot.equals(MainUtil.getPlot(BukkitUtil.getLocation(from)))) { player.teleport(from);