Remove hacky "softCancel" thing

This commit is contained in:
Brady 2018-09-12 17:25:01 -05:00
parent 2fd888b9ee
commit fb8ee44447
No known key found for this signature in database
GPG Key ID: 73A788379A197567
1 changed files with 3 additions and 7 deletions

View File

@ -66,9 +66,10 @@ public final class PathingBehavior extends Behavior {
@Override
public void onTick(TickEvent event) {
if (event.getType() == TickEvent.Type.OUT) {
softCancel(); // no player, so can't fix capabilities
this.cancel();
return;
}
mc.playerController.setPlayerCapabilities(mc.player);
if (current == null) {
return;
}
@ -191,18 +192,13 @@ public final class PathingBehavior extends Behavior {
return Optional.ofNullable(current).map(PathExecutor::getPath);
}
private void softCancel() {
public void cancel() {
current = null;
next = null;
Baritone.INSTANCE.getInputOverrideHandler().clearAllKeys();
AbstractNodeCostSearch.getCurrentlyRunning().ifPresent(AbstractNodeCostSearch::cancel);
}
public void cancel() {
softCancel();
mc.playerController.setPlayerCapabilities(mc.player);
}
/**
* Start calculating a path if we aren't already
*