diff --git a/worldguard-core/src/main/java/com/sk89q/worldguard/session/handler/FlagValueChangeHandler.java b/worldguard-core/src/main/java/com/sk89q/worldguard/session/handler/FlagValueChangeHandler.java index 065b4191..a8f144e3 100644 --- a/worldguard-core/src/main/java/com/sk89q/worldguard/session/handler/FlagValueChangeHandler.java +++ b/worldguard-core/src/main/java/com/sk89q/worldguard/session/handler/FlagValueChangeHandler.java @@ -81,7 +81,9 @@ public boolean onCrossBoundary(LocalPlayer player, Location from, Location to, A protected abstract boolean onAbsentValue(LocalPlayer player, Location from, Location to, ApplicableRegionSet toSet, T lastValue, MoveType moveType); protected void onClearValue(LocalPlayer player, ApplicableRegionSet set) { - Location current = player.getLocation(); - onAbsentValue(player, current, current, set, lastValue, MoveType.OTHER_NON_CANCELLABLE); + if (lastValue != null) { + Location current = player.getLocation(); + onAbsentValue(player, current, current, set, lastValue, MoveType.OTHER_NON_CANCELLABLE); + } } } diff --git a/worldguard-core/src/main/java/com/sk89q/worldguard/session/handler/NotifyExitFlag.java b/worldguard-core/src/main/java/com/sk89q/worldguard/session/handler/NotifyExitFlag.java index 7fd779b8..4da1af8d 100644 --- a/worldguard-core/src/main/java/com/sk89q/worldguard/session/handler/NotifyExitFlag.java +++ b/worldguard-core/src/main/java/com/sk89q/worldguard/session/handler/NotifyExitFlag.java @@ -59,4 +59,8 @@ protected boolean onAbsentValue(LocalPlayer player, Location from, Location to, WorldGuard.getInstance().getPlatform().broadcastNotification(new Notify(player.getName(), " left NOTIFY region").create()); return true; } + + @Override + protected void onClearValue(LocalPlayer player, ApplicableRegionSet set) { + } }