Fix deny-exit flag

This commit is contained in:
Jesse Boyd 2018-02-15 18:59:40 +11:00
parent c98f2b4261
commit eb1c3263ec
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -179,7 +179,7 @@ public class PlotListener {
}
public static boolean plotExit(final PlotPlayer player, Plot plot) {
player.deleteMeta("lastplot");
Object previous = player.deleteMeta("lastplot");
EventUtil.manager.callLeave(player, plot);
if (plot.hasOwner()) {
PlotArea pw = plot.getArea();
@ -187,6 +187,9 @@ public class PlotListener {
return true;
}
if (Flags.DENY_EXIT.isTrue(plot)) {
if (previous != null) {
player.setMeta("lastplot", previous);
}
return false;
}
if (plot.getFlag(Flags.GAMEMODE).isPresent() || plot.getFlag(Flags.GUEST_GAMEMODE).isPresent()) {