Unify getCurrentDestination semantics

This commit is contained in:
fullwall 2022-05-26 22:07:26 +08:00
parent 8a78c5788f
commit 1c459c3da2
3 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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