mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 07:06:44 +01:00
Add "kick" meta check in PlotListener
This commit is contained in:
parent
b2d035cf69
commit
44fc8a55ea
@ -157,23 +157,21 @@ public class PlotListener {
|
|||||||
if (titles) {
|
if (titles) {
|
||||||
if (!C.TITLE_ENTERED_PLOT.s().isEmpty() || !C.TITLE_ENTERED_PLOT_SUB.s()
|
if (!C.TITLE_ENTERED_PLOT.s().isEmpty() || !C.TITLE_ENTERED_PLOT_SUB.s()
|
||||||
.isEmpty()) {
|
.isEmpty()) {
|
||||||
TaskManager.runTaskLaterAsync(new Runnable() {
|
TaskManager.runTaskLaterAsync(() -> {
|
||||||
@Override public void run() {
|
Plot lastPlot = player.getMeta(PlotPlayer.META_LAST_PLOT);
|
||||||
Plot lastPlot = player.getMeta(PlotPlayer.META_LAST_PLOT);
|
if ((lastPlot != null) && plot.getId().equals(lastPlot.getId())) {
|
||||||
if ((lastPlot != null) && plot.getId().equals(lastPlot.getId())) {
|
Map<String, String> replacements = new HashMap<>();
|
||||||
Map<String, String> replacements = new HashMap<>();
|
replacements.put("%x%", String.valueOf(lastPlot.getId().x));
|
||||||
replacements.put("%x%", String.valueOf(lastPlot.getId().x));
|
replacements.put("%z%", lastPlot.getId().y + "");
|
||||||
replacements.put("%z%", lastPlot.getId().y + "");
|
replacements.put("%world%", plot.getArea().toString());
|
||||||
replacements.put("%world%", plot.getArea().toString());
|
replacements.put("%greeting%", greeting);
|
||||||
replacements.put("%greeting%", greeting);
|
replacements.put("%alias", plot.toString());
|
||||||
replacements.put("%alias", plot.toString());
|
replacements.put("%s", MainUtil.getName(plot.owner));
|
||||||
replacements.put("%s", MainUtil.getName(plot.owner));
|
String main = StringMan
|
||||||
String main = StringMan
|
.replaceFromMap(C.TITLE_ENTERED_PLOT.s(), replacements);
|
||||||
.replaceFromMap(C.TITLE_ENTERED_PLOT.s(), replacements);
|
String sub = StringMan
|
||||||
String sub = StringMan
|
.replaceFromMap(C.TITLE_ENTERED_PLOT_SUB.s(), replacements);
|
||||||
.replaceFromMap(C.TITLE_ENTERED_PLOT_SUB.s(), replacements);
|
AbstractTitle.sendTitle(player, main, sub);
|
||||||
AbstractTitle.sendTitle(player, main, sub);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}, 20);
|
}, 20);
|
||||||
}
|
}
|
||||||
@ -191,7 +189,7 @@ public class PlotListener {
|
|||||||
if (pw == null) {
|
if (pw == null) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (Flags.DENY_EXIT.isTrue(plot)) {
|
if (Flags.DENY_EXIT.isTrue(plot) && !player.getMeta("kick", false)) {
|
||||||
if (previous != null) {
|
if (previous != null) {
|
||||||
player.setMeta(PlotPlayer.META_LAST_PLOT, previous);
|
player.setMeta(PlotPlayer.META_LAST_PLOT, previous);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user