From 246c00c7733885a6ab8026e6a9088b829d2f34ea Mon Sep 17 00:00:00 2001 From: Leijurv Date: Thu, 31 Jan 2019 19:19:44 -0800 Subject: [PATCH] dont repeat that --- .../java/baritone/pathing/path/PathExecutor.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/baritone/pathing/path/PathExecutor.java b/src/main/java/baritone/pathing/path/PathExecutor.java index a2c0e2ff..8ad0db59 100644 --- a/src/main/java/baritone/pathing/path/PathExecutor.java +++ b/src/main/java/baritone/pathing/path/PathExecutor.java @@ -377,21 +377,21 @@ public class PathExecutor implements IPathExecutor, Helper { } private boolean shouldSprintNextTick() { + boolean requested = behavior.baritone.getInputOverrideHandler().isInputForcedDown(Input.SPRINT); + + // we'll take it from here, no need for minecraft to see we're holding down control and sprint for us + behavior.baritone.getInputOverrideHandler().setInputForceState(Input.SPRINT, false); + // first and foremost, if allowSprint is off, or if we don't have enough hunger, don't try and sprint if (!new CalculationContext(behavior.baritone).canSprint) { - behavior.baritone.getInputOverrideHandler().setInputForceState(Input.SPRINT, false); return false; } // if the movement requested sprinting, then we're done - if (behavior.baritone.getInputOverrideHandler().isInputForcedDown(Input.SPRINT)) { - behavior.baritone.getInputOverrideHandler().setInputForceState(Input.SPRINT, false); + if (requested) { return true; } - // we'll take it from here, no need for minecraft to see we're holding down control and sprint for us - behavior.baritone.getInputOverrideHandler().setInputForceState(Input.SPRINT, false); - // however, descend doesn't request sprinting, beceause it doesn't know the context of what movement comes after it IMovement current = path.movements().get(pathPosition); if (current instanceof MovementDescend) {