mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-28 03:57:35 +01:00
Respect plugin setting of useNewPathfinder better
This commit is contained in:
parent
3c08d3c5b6
commit
af40da3c0e
@ -31,7 +31,7 @@ public class CitizensNavigator implements Navigator, Runnable {
|
||||
private final NavigatorParameters defaultParams = new NavigatorParameters().baseSpeed(UNINITIALISED_SPEED)
|
||||
.range(Setting.DEFAULT_PATHFINDING_RANGE.asFloat())
|
||||
.stationaryTicks(Setting.DEFAULT_STATIONARY_TICKS.asInt()).stuckAction(TeleportStuckAction.INSTANCE)
|
||||
.examiner(new MinecraftBlockExaminer());
|
||||
.examiner(new MinecraftBlockExaminer()).useNewPathfinder(Setting.USE_NEW_PATHFINDER.asBoolean());
|
||||
private PathStrategy executing;
|
||||
private int lastX, lastY, lastZ;
|
||||
private NavigatorParameters localParams = defaultParams;
|
||||
@ -161,7 +161,7 @@ public class CitizensNavigator implements Navigator, Runnable {
|
||||
}
|
||||
localParams = defaultParams.clone();
|
||||
PathStrategy newStrategy;
|
||||
if (Setting.USE_NEW_PATHFINDER.asBoolean() || localParams.useNewPathfinder()) {
|
||||
if (localParams.useNewPathfinder()) {
|
||||
newStrategy = new AStarNavigationStrategy(npc, target, localParams);
|
||||
} else {
|
||||
newStrategy = new MCNavigationStrategy(npc, target, localParams);
|
||||
|
@ -40,8 +40,8 @@ public class MCTargetStrategy implements PathStrategy, EntityTarget {
|
||||
this.handle = ((CraftLivingEntity) npc.getBukkitEntity()).getHandle();
|
||||
this.target = ((CraftEntity) target).getHandle();
|
||||
Navigation nav = NMS.getNavigation(this.handle);
|
||||
this.targetNavigator = nav != null && !Setting.USE_NEW_PATHFINDER.asBoolean() && !params.useNewPathfinder() ? new NavigationFieldWrapper(
|
||||
nav) : new AStarTargeter();
|
||||
this.targetNavigator = nav != null && !params.useNewPathfinder() ? new NavigationFieldWrapper(nav)
|
||||
: new AStarTargeter();
|
||||
this.aggro = aggro;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user