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
|
@Override
|
||||||
public boolean isPaused() {
|
public boolean isPaused() {
|
||||||
return currentGoal.isPaused();
|
return currentGoal == null ? false : currentGoal.isPaused();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -118,7 +118,10 @@ public class LinearWaypointProvider implements EnumerableWaypointProvider {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRemove() {
|
public void onRemove() {
|
||||||
|
if (currentGoal != null) {
|
||||||
npc.getDefaultGoalController().removeGoal(currentGoal);
|
npc.getDefaultGoalController().removeGoal(currentGoal);
|
||||||
|
currentGoal = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user