mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-29 13:05:41 +01:00
Fix plot music duplication when moving between plots in a merged plot
This commit is contained in:
parent
4669f31658
commit
f921db937a
@ -401,7 +401,7 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen
|
|||||||
pp.deleteMeta("lastplot");
|
pp.deleteMeta("lastplot");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Plot now = area.getPlotAbs(loc);
|
Plot now = area.getPlot(loc);
|
||||||
final Plot lastPlot = pp.getMeta("lastplot");
|
final Plot lastPlot = pp.getMeta("lastplot");
|
||||||
if (now == null) {
|
if (now == null) {
|
||||||
if (lastPlot != null && !plotExit(pp, lastPlot)) {
|
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()))) {
|
if (MathMan.roundInt(from.getZ()) != (z2 = MathMan.roundInt(to.getZ()))) {
|
||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
final PlotPlayer pp = BukkitUtil.getPlayer(player);
|
final PlotPlayer pp = BukkitUtil.getPlayer(player);
|
||||||
|
|
||||||
// Cancel teleport
|
// Cancel teleport
|
||||||
TaskManager.TELEPORT_QUEUE.remove(pp.getName());
|
TaskManager.TELEPORT_QUEUE.remove(pp.getName());
|
||||||
|
|
||||||
// Set last location
|
// Set last location
|
||||||
Location loc = BukkitUtil.getLocation(to);
|
Location loc = BukkitUtil.getLocation(to);
|
||||||
pp.setMeta("location", loc);
|
pp.setMeta("location", loc);
|
||||||
|
|
||||||
PlotArea area = loc.getPlotArea();
|
PlotArea area = loc.getPlotArea();
|
||||||
if (area == null) {
|
if (area == null) {
|
||||||
pp.deleteMeta("lastplot");
|
pp.deleteMeta("lastplot");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Plot now = area.getPlotAbs(loc);
|
Plot now = area.getPlot(loc);
|
||||||
final Plot lastPlot = pp.getMeta("lastplot");
|
final Plot lastPlot = pp.getMeta("lastplot");
|
||||||
if (now == null) {
|
if (now == null) {
|
||||||
if (lastPlot != null && !plotExit(pp, lastPlot)) {
|
if (lastPlot != null && !plotExit(pp, lastPlot)) {
|
||||||
|
@ -51,6 +51,7 @@ import java.util.UUID;
|
|||||||
public class PlotListener {
|
public class PlotListener {
|
||||||
|
|
||||||
public static boolean plotEntry(final PlotPlayer pp, final Plot plot) {
|
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")) {
|
if (plot.isDenied(pp.getUUID()) && !Permissions.hasPermission(pp, "plots.admin.entry.denied")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -58,7 +59,7 @@ public class PlotListener {
|
|||||||
if ((last != null) && !last.getId().equals(plot.getId())) {
|
if ((last != null) && !last.getId().equals(plot.getId())) {
|
||||||
plotExit(pp, last);
|
plotExit(pp, last);
|
||||||
}
|
}
|
||||||
pp.setMeta("lastplot", plot.getBasePlot(false));
|
pp.setMeta("lastplot", plot);
|
||||||
EventUtil.manager.callEntry(pp, plot);
|
EventUtil.manager.callEntry(pp, plot);
|
||||||
if (plot.hasOwner()) {
|
if (plot.hasOwner()) {
|
||||||
final HashMap<String, Flag> flags = FlagManager.getPlotFlags(plot);
|
final HashMap<String, Flag> flags = FlagManager.getPlotFlags(plot);
|
||||||
|
Loading…
Reference in New Issue
Block a user