mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-24 03:25:13 +01:00
Fix CITIZENS-436 (can't pathfind between worlds)
This commit is contained in:
parent
da03a3cd26
commit
de445ff1b2
@ -400,11 +400,14 @@ public class LinearWaypointProvider implements WaypointProvider {
|
||||
return false;
|
||||
this.selector = selector;
|
||||
Waypoint next = itr.next();
|
||||
if (npc.getBukkitEntity().getLocation().distanceSquared(next.getLocation()) < 3)
|
||||
Location npcLoc = npc.getBukkitEntity().getLocation(cachedLocation);
|
||||
if (npcLoc.getWorld() != next.getLocation().getWorld() || npcLoc.distanceSquared(next.getLocation()) < 3)
|
||||
return false;
|
||||
currentDestination = next;
|
||||
getNavigator().setTarget(currentDestination.getLocation());
|
||||
return true;
|
||||
}
|
||||
|
||||
private final Location cachedLocation = new Location(null, 0, 0, 0);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user