mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-30 14:43:54 +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;
|
return false;
|
||||||
this.selector = selector;
|
this.selector = selector;
|
||||||
Waypoint next = itr.next();
|
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;
|
return false;
|
||||||
currentDestination = next;
|
currentDestination = next;
|
||||||
getNavigator().setTarget(currentDestination.getLocation());
|
getNavigator().setTarget(currentDestination.getLocation());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private final Location cachedLocation = new Location(null, 0, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user