mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-14 22:56:24 +01:00
Explicitly shutdown the navigator
This commit is contained in:
parent
5dd6b6d6b2
commit
8391b793ef
@ -129,6 +129,8 @@ public class CitizensNavigator implements Navigator {
|
||||
}
|
||||
|
||||
private void stopNavigating() {
|
||||
if (executing != null)
|
||||
executing.stop();
|
||||
executing = null;
|
||||
localParams = defaultParams;
|
||||
}
|
||||
|
@ -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());
|
||||
|
@ -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;
|
||||
|
@ -9,5 +9,7 @@ public interface PathStrategy {
|
||||
|
||||
TargetType getTargetType();
|
||||
|
||||
void stop();
|
||||
|
||||
boolean update();
|
||||
}
|
Loading…
Reference in New Issue
Block a user