Remove hacky "softCancel" thing
This commit is contained in:
parent
2fd888b9ee
commit
fb8ee44447
@ -66,9 +66,10 @@ public final class PathingBehavior extends Behavior {
|
|||||||
@Override
|
@Override
|
||||||
public void onTick(TickEvent event) {
|
public void onTick(TickEvent event) {
|
||||||
if (event.getType() == TickEvent.Type.OUT) {
|
if (event.getType() == TickEvent.Type.OUT) {
|
||||||
softCancel(); // no player, so can't fix capabilities
|
this.cancel();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
mc.playerController.setPlayerCapabilities(mc.player);
|
||||||
if (current == null) {
|
if (current == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -191,18 +192,13 @@ public final class PathingBehavior extends Behavior {
|
|||||||
return Optional.ofNullable(current).map(PathExecutor::getPath);
|
return Optional.ofNullable(current).map(PathExecutor::getPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void softCancel() {
|
public void cancel() {
|
||||||
current = null;
|
current = null;
|
||||||
next = null;
|
next = null;
|
||||||
Baritone.INSTANCE.getInputOverrideHandler().clearAllKeys();
|
Baritone.INSTANCE.getInputOverrideHandler().clearAllKeys();
|
||||||
AbstractNodeCostSearch.getCurrentlyRunning().ifPresent(AbstractNodeCostSearch::cancel);
|
AbstractNodeCostSearch.getCurrentlyRunning().ifPresent(AbstractNodeCostSearch::cancel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cancel() {
|
|
||||||
softCancel();
|
|
||||||
mc.playerController.setPlayerCapabilities(mc.player);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start calculating a path if we aren't already
|
* Start calculating a path if we aren't already
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user