From e6c574063e86547d07e2c27db4004668fd2e855d Mon Sep 17 00:00:00 2001 From: Brady Date: Tue, 11 Sep 2018 17:37:26 -0500 Subject: [PATCH] Prevent flying capabilities when pathing, fixes #130 --- src/main/java/baritone/behavior/impl/PathingBehavior.java | 1 + src/main/java/baritone/pathing/path/PathExecutor.java | 1 + 2 files changed, 2 insertions(+) diff --git a/src/main/java/baritone/behavior/impl/PathingBehavior.java b/src/main/java/baritone/behavior/impl/PathingBehavior.java index cd4cf357..f5c81acd 100644 --- a/src/main/java/baritone/behavior/impl/PathingBehavior.java +++ b/src/main/java/baritone/behavior/impl/PathingBehavior.java @@ -196,6 +196,7 @@ public class PathingBehavior extends Behavior { next = null; Baritone.INSTANCE.getInputOverrideHandler().clearAllKeys(); AbstractNodeCostSearch.getCurrentlyRunning().ifPresent(AbstractNodeCostSearch::cancel); + mc.playerController.setPlayerCapabilities(mc.player); } /** diff --git a/src/main/java/baritone/pathing/path/PathExecutor.java b/src/main/java/baritone/pathing/path/PathExecutor.java index 5a8af7db..e59d9aa7 100644 --- a/src/main/java/baritone/pathing/path/PathExecutor.java +++ b/src/main/java/baritone/pathing/path/PathExecutor.java @@ -236,6 +236,7 @@ public class PathExecutor implements Helper { Baritone.INSTANCE.getInputOverrideHandler().clearAllKeys(); return true; } + player().capabilities.allowFlying = false; MovementState.MovementStatus movementStatus = movement.update(); if (movementStatus == UNREACHABLE || movementStatus == FAILED) { logDebug("Movement returns status " + movementStatus);