Prevent flying capabilities when pathing, fixes #130

This commit is contained in:
Brady 2018-09-11 17:37:26 -05:00
parent ff2714b15f
commit e6c574063e
No known key found for this signature in database
GPG Key ID: 73A788379A197567
2 changed files with 2 additions and 0 deletions

View File

@ -196,6 +196,7 @@ public class PathingBehavior extends Behavior {
next = null; next = null;
Baritone.INSTANCE.getInputOverrideHandler().clearAllKeys(); Baritone.INSTANCE.getInputOverrideHandler().clearAllKeys();
AbstractNodeCostSearch.getCurrentlyRunning().ifPresent(AbstractNodeCostSearch::cancel); AbstractNodeCostSearch.getCurrentlyRunning().ifPresent(AbstractNodeCostSearch::cancel);
mc.playerController.setPlayerCapabilities(mc.player);
} }
/** /**

View File

@ -236,6 +236,7 @@ public class PathExecutor implements Helper {
Baritone.INSTANCE.getInputOverrideHandler().clearAllKeys(); Baritone.INSTANCE.getInputOverrideHandler().clearAllKeys();
return true; return true;
} }
player().capabilities.allowFlying = false;
MovementState.MovementStatus movementStatus = movement.update(); MovementState.MovementStatus movementStatus = movement.update();
if (movementStatus == UNREACHABLE || movementStatus == FAILED) { if (movementStatus == UNREACHABLE || movementStatus == FAILED) {
logDebug("Movement returns status " + movementStatus); logDebug("Movement returns status " + movementStatus);