mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-27 21:29:14 +01:00
Fix bugs
This commit is contained in:
parent
c3630c1da3
commit
c71f226abd
@ -299,7 +299,12 @@ public class LinearWaypointProvider implements WaypointProvider {
|
||||
if (selector == null || !event.getNavigator().equals(getNavigator()))
|
||||
return;
|
||||
selector.finish();
|
||||
if (event.getNavigator().getTargetAsLocation().equals(currentDestination.getLocation()))
|
||||
Location finished = event.getNavigator().getTargetAsLocation();
|
||||
if (finished == null || currentDestination == null)
|
||||
return;
|
||||
if (finished.getWorld() != currentDestination.getLocation().getWorld())
|
||||
return;
|
||||
if (finished.equals(currentDestination.getLocation()))
|
||||
currentDestination.onReach(npc);
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,8 @@ public class Waypoint {
|
||||
}
|
||||
|
||||
public void onReach(NPC npc) {
|
||||
if (triggers == null)
|
||||
return;
|
||||
for (WaypointTrigger trigger : triggers)
|
||||
trigger.onWaypointReached(npc, location);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user