mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-13 03:40:39 +01:00
Unify getCurrentDestination semantics
This commit is contained in:
parent
8a78c5788f
commit
1c459c3da2
@ -56,7 +56,7 @@ public class AStarNavigationStrategy extends AbstractPathStrategy {
|
||||
|
||||
@Override
|
||||
public Location getCurrentDestination() {
|
||||
return plan != null ? plan.getCurrentVector().toLocation(npc.getEntity().getWorld()) : destination.clone();
|
||||
return vector != null ? vector.toLocation(npc.getEntity().getWorld()) : destination.clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -58,7 +58,7 @@ public class FlyingAStarNavigationStrategy extends AbstractPathStrategy {
|
||||
|
||||
@Override
|
||||
public Location getCurrentDestination() {
|
||||
return vector != null ? vector.toLocation(npc.getEntity().getWorld()) : null;
|
||||
return vector != null ? vector.toLocation(npc.getEntity().getWorld()) : target.clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,7 +45,8 @@ public class MCNavigationStrategy extends AbstractPathStrategy {
|
||||
|
||||
@Override
|
||||
public Location getCurrentDestination() {
|
||||
return NMS.getDestination(entity);
|
||||
Location dest = NMS.getDestination(entity);
|
||||
return dest != null ? dest : target.clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user