Fix CITIZENS-436 (can't pathfind between worlds)

This commit is contained in:
fullwall 2013-02-11 11:45:08 +08:00
parent da03a3cd26
commit de445ff1b2

View File

@ -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);
} }
} }