From 9e15960581affd8a19d5cc1c61ffa261c04f600e Mon Sep 17 00:00:00 2001 From: Leijurv Date: Tue, 9 Oct 2018 16:13:46 -0700 Subject: [PATCH] fix pause stuttering, fixes #216 --- src/main/java/baritone/pathing/path/PathExecutor.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/baritone/pathing/path/PathExecutor.java b/src/main/java/baritone/pathing/path/PathExecutor.java index 6fba09a3..6f531857 100644 --- a/src/main/java/baritone/pathing/path/PathExecutor.java +++ b/src/main/java/baritone/pathing/path/PathExecutor.java @@ -19,10 +19,10 @@ package baritone.pathing.path; import baritone.Baritone; import baritone.api.event.events.TickEvent; +import baritone.api.pathing.calc.IPath; import baritone.api.pathing.movement.ActionCosts; import baritone.api.pathing.movement.IMovement; import baritone.api.pathing.movement.MovementStatus; -import baritone.api.pathing.calc.IPath; import baritone.api.pathing.path.IPathExecutor; import baritone.api.utils.BetterBlockPos; import baritone.pathing.calc.AbstractNodeCostSearch; @@ -244,6 +244,7 @@ public class PathExecutor implements IPathExecutor, Helper { } if (shouldPause()) { logDebug("Pausing since current best path is a backtrack"); + clearKeys(); return true; } MovementStatus movementStatus = movement.update(); @@ -342,7 +343,7 @@ public class PathExecutor implements IPathExecutor, Helper { // first and foremost, if allowSprint is off, or if we don't have enough hunger, don't try and sprint if (!new CalculationContext().canSprint()) { - Baritone.INSTANCE.getInputOverrideHandler().setInputForceState(InputOverrideHandler.Input.SPRINT,false); + Baritone.INSTANCE.getInputOverrideHandler().setInputForceState(InputOverrideHandler.Input.SPRINT, false); player().setSprinting(false); return; } @@ -356,7 +357,7 @@ public class PathExecutor implements IPathExecutor, Helper { } // we'll take it from here, no need for minecraft to see we're holding down control and sprint for us - Baritone.INSTANCE.getInputOverrideHandler().setInputForceState(InputOverrideHandler.Input.SPRINT,false); + Baritone.INSTANCE.getInputOverrideHandler().setInputForceState(InputOverrideHandler.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);