mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-23 11:05:49 +01:00
Make LinearWaypointProvider more null safe
This commit is contained in:
parent
3186f6de5e
commit
5972e3dffc
@ -103,7 +103,7 @@ public class LinearWaypointProvider implements EnumerableWaypointProvider {
|
||||
|
||||
@Override
|
||||
public boolean isPaused() {
|
||||
return currentGoal.isPaused();
|
||||
return currentGoal == null ? false : currentGoal.isPaused();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -118,7 +118,10 @@ public class LinearWaypointProvider implements EnumerableWaypointProvider {
|
||||
|
||||
@Override
|
||||
public void onRemove() {
|
||||
if (currentGoal != null) {
|
||||
npc.getDefaultGoalController().removeGoal(currentGoal);
|
||||
currentGoal = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user