From 44fc8a55ea6fdeb1a666eb402597fe7ba2ba2e1b Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Mon, 14 Jan 2019 17:41:28 +0000 Subject: [PATCH] Add "kick" meta check in PlotListener --- .../plot/listener/PlotListener.java | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java index 64b4adcaa..dd9547b26 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java @@ -157,23 +157,21 @@ public class PlotListener { if (titles) { if (!C.TITLE_ENTERED_PLOT.s().isEmpty() || !C.TITLE_ENTERED_PLOT_SUB.s() .isEmpty()) { - TaskManager.runTaskLaterAsync(new Runnable() { - @Override public void run() { - Plot lastPlot = player.getMeta(PlotPlayer.META_LAST_PLOT); - if ((lastPlot != null) && plot.getId().equals(lastPlot.getId())) { - Map replacements = new HashMap<>(); - replacements.put("%x%", String.valueOf(lastPlot.getId().x)); - replacements.put("%z%", lastPlot.getId().y + ""); - replacements.put("%world%", plot.getArea().toString()); - replacements.put("%greeting%", greeting); - replacements.put("%alias", plot.toString()); - replacements.put("%s", MainUtil.getName(plot.owner)); - String main = StringMan - .replaceFromMap(C.TITLE_ENTERED_PLOT.s(), replacements); - String sub = StringMan - .replaceFromMap(C.TITLE_ENTERED_PLOT_SUB.s(), replacements); - AbstractTitle.sendTitle(player, main, sub); - } + TaskManager.runTaskLaterAsync(() -> { + Plot lastPlot = player.getMeta(PlotPlayer.META_LAST_PLOT); + if ((lastPlot != null) && plot.getId().equals(lastPlot.getId())) { + Map replacements = new HashMap<>(); + replacements.put("%x%", String.valueOf(lastPlot.getId().x)); + replacements.put("%z%", lastPlot.getId().y + ""); + replacements.put("%world%", plot.getArea().toString()); + replacements.put("%greeting%", greeting); + replacements.put("%alias", plot.toString()); + replacements.put("%s", MainUtil.getName(plot.owner)); + String main = StringMan + .replaceFromMap(C.TITLE_ENTERED_PLOT.s(), replacements); + String sub = StringMan + .replaceFromMap(C.TITLE_ENTERED_PLOT_SUB.s(), replacements); + AbstractTitle.sendTitle(player, main, sub); } }, 20); } @@ -191,7 +189,7 @@ public class PlotListener { if (pw == null) { return true; } - if (Flags.DENY_EXIT.isTrue(plot)) { + if (Flags.DENY_EXIT.isTrue(plot) && !player.getMeta("kick", false)) { if (previous != null) { player.setMeta(PlotPlayer.META_LAST_PLOT, previous); }