From f921db937a1b70b59329056182af243e406c34dc Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Fri, 26 Feb 2016 17:43:49 +1100 Subject: [PATCH] Fix plot music duplication when moving between plots in a merged plot --- .../com/plotsquared/bukkit/listeners/PlayerEvents.java | 7 ++----- .../main/java/com/plotsquared/listener/PlotListener.java | 3 ++- 2 files changed, 4 insertions(+), 6 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 adabc5b01..b5057353c 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java @@ -401,7 +401,7 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen pp.deleteMeta("lastplot"); return; } - Plot now = area.getPlotAbs(loc); + Plot now = area.getPlot(loc); final Plot lastPlot = pp.getMeta("lastplot"); if (now == null) { if (lastPlot != null && !plotExit(pp, lastPlot)) { @@ -440,20 +440,17 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen if (MathMan.roundInt(from.getZ()) != (z2 = MathMan.roundInt(to.getZ()))) { final Player player = event.getPlayer(); final PlotPlayer pp = BukkitUtil.getPlayer(player); - // Cancel teleport TaskManager.TELEPORT_QUEUE.remove(pp.getName()); - // Set last location Location loc = BukkitUtil.getLocation(to); pp.setMeta("location", loc); - PlotArea area = loc.getPlotArea(); if (area == null) { pp.deleteMeta("lastplot"); return; } - Plot now = area.getPlotAbs(loc); + Plot now = area.getPlot(loc); final Plot lastPlot = pp.getMeta("lastplot"); if (now == null) { if (lastPlot != null && !plotExit(pp, lastPlot)) { diff --git a/Core/src/main/java/com/plotsquared/listener/PlotListener.java b/Core/src/main/java/com/plotsquared/listener/PlotListener.java index 017609179..b28fcc400 100644 --- a/Core/src/main/java/com/plotsquared/listener/PlotListener.java +++ b/Core/src/main/java/com/plotsquared/listener/PlotListener.java @@ -51,6 +51,7 @@ import java.util.UUID; public class PlotListener { public static boolean plotEntry(final PlotPlayer pp, final Plot plot) { + System.out.println("POLOT ENTRY"); if (plot.isDenied(pp.getUUID()) && !Permissions.hasPermission(pp, "plots.admin.entry.denied")) { return false; } @@ -58,7 +59,7 @@ public class PlotListener { if ((last != null) && !last.getId().equals(plot.getId())) { plotExit(pp, last); } - pp.setMeta("lastplot", plot.getBasePlot(false)); + pp.setMeta("lastplot", plot); EventUtil.manager.callEntry(pp, plot); if (plot.hasOwner()) { final HashMap flags = FlagManager.getPlotFlags(plot);