mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-23 00:21:31 +01:00
Check pathfinding range while pathfinding
This commit is contained in:
parent
417f0f1691
commit
b5c433c594
@ -148,6 +148,10 @@ public class CitizensNavigator implements Navigator, Runnable {
|
||||
updateMountedStatus();
|
||||
if (!isNavigating() || !npc.isSpawned() || paused)
|
||||
return;
|
||||
if (Math.pow(localParams.range(), 2) < npc.getStoredLocation().distanceSquared(getTargetAsLocation())) {
|
||||
stopNavigating(CancelReason.STUCK);
|
||||
return;
|
||||
}
|
||||
if (updateStationaryStatus())
|
||||
return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user