Merge branch 'master' of github.com:CitizensDev/Citizens2

This commit is contained in:
fullwall 2014-10-08 01:12:48 +08:00
commit ec2eae62b7

View File

@ -225,12 +225,12 @@ public class CitizensNavigator implements Navigator, Runnable {
stopNavigating(); stopNavigating();
return; return;
} }
if (reason == CancelReason.STUCK && localParams.stuckAction() != null) { if (reason == CancelReason.STUCK) {
StuckAction action = localParams.stuckAction(); StuckAction action = localParams.stuckAction();
NavigationStuckEvent event = new NavigationStuckEvent(this, action); NavigationStuckEvent event = new NavigationStuckEvent(this, action);
Bukkit.getPluginManager().callEvent(event); Bukkit.getPluginManager().callEvent(event);
action = event.getAction(); action = event.getAction();
boolean shouldContinue = action.run(npc, this); boolean shouldContinue = action != null ? action.run(npc, this): false;
if (shouldContinue) { if (shouldContinue) {
stationaryTicks = 0; stationaryTicks = 0;
executing.clearCancelReason(); executing.clearCancelReason();