mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-26 04:35:50 +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() {
|
private void stopNavigating() {
|
||||||
|
if (executing != null)
|
||||||
|
executing.stop();
|
||||||
executing = null;
|
executing = null;
|
||||||
localParams = defaultParams;
|
localParams = defaultParams;
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,11 @@ public class MCNavigationStrategy implements PathStrategy {
|
|||||||
return TargetType.LOCATION;
|
return TargetType.LOCATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void stop() {
|
||||||
|
navigation.g();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean update() {
|
public boolean update() {
|
||||||
navigation.a(parameters.avoidWater());
|
navigation.a(parameters.avoidWater());
|
||||||
|
@ -60,6 +60,11 @@ public class MCTargetStrategy implements PathStrategy, EntityTarget {
|
|||||||
return aggro;
|
return aggro;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void stop() {
|
||||||
|
navigation.g();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean update() {
|
public boolean update() {
|
||||||
if (target == null || target.dead)
|
if (target == null || target.dead)
|
||||||
@ -83,7 +88,6 @@ public class MCTargetStrategy implements PathStrategy, EntityTarget {
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final int ATTACK_DELAY_TICKS = 20;
|
private static final int ATTACK_DELAY_TICKS = 20;
|
||||||
|
|
||||||
private static final double ATTACK_DISTANCE = 1.75 * 1.75;
|
private static final double ATTACK_DISTANCE = 1.75 * 1.75;
|
||||||
|
@ -9,5 +9,7 @@ public interface PathStrategy {
|
|||||||
|
|
||||||
TargetType getTargetType();
|
TargetType getTargetType();
|
||||||
|
|
||||||
|
void stop();
|
||||||
|
|
||||||
boolean update();
|
boolean update();
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user