Skip to content

Commit

Permalink
Unify getCurrentDestination semantics
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed May 26, 2022
1 parent 8a78c57 commit 1c459c3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public AStarNavigationStrategy(NPC npc, Location dest, NavigatorParameters param

@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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public FlyingAStarNavigationStrategy(final NPC npc, Location dest, NavigatorPara

@Override
public Location getCurrentDestination() {
return vector != null ? vector.toLocation(npc.getEntity().getWorld()) : null;
return vector != null ? vector.toLocation(npc.getEntity().getWorld()) : target.clone();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1c459c3

Please sign in to comment.