Explicitly shutdown the navigator

This commit is contained in:
fullwall 2012-09-03 15:58:21 +08:00
parent 9d33257deb
commit 7377093c6a
4 changed files with 14 additions and 1 deletions

View File

@ -129,6 +129,8 @@ public class CitizensNavigator implements Navigator {
}
private void stopNavigating() {
if (executing != null)
executing.stop();
executing = null;
localParams = defaultParams;
}

View File

@ -41,6 +41,11 @@ public class MCNavigationStrategy implements PathStrategy {
return TargetType.LOCATION;
}
@Override
public void stop() {
navigation.g();
}
@Override
public boolean update() {
navigation.a(parameters.avoidWater());

View File

@ -60,6 +60,11 @@ public class MCTargetStrategy implements PathStrategy, EntityTarget {
return aggro;
}
@Override
public void stop() {
navigation.g();
}
@Override
public boolean update() {
if (target == null || target.dead)
@ -83,7 +88,6 @@ public class MCTargetStrategy implements PathStrategy, EntityTarget {
return false;
}
private static final int ATTACK_DELAY_TICKS = 20;
private static final double ATTACK_DISTANCE = 1.75 * 1.75;

View File

@ -9,5 +9,7 @@ public interface PathStrategy {
TargetType getTargetType();
void stop();
boolean update();
}