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