actually stop sprinting, fixes #199

This commit is contained in:
leijurv 2018-10-07 21:39:43 -07:00 committed by Leijurv
parent 7481c98dbc
commit 60c29fd159
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -329,6 +329,7 @@ public class PathExecutor implements Helper {
// first and foremost, if allowSprint is off, or if we don't have enough hunger, don't try and sprint // first and foremost, if allowSprint is off, or if we don't have enough hunger, don't try and sprint
if (!new CalculationContext().canSprint()) { if (!new CalculationContext().canSprint()) {
Baritone.INSTANCE.getInputOverrideHandler().setInputForceState(InputOverrideHandler.Input.SPRINT,false);
player().setSprinting(false); player().setSprinting(false);
return; return;
} }
@ -341,6 +342,9 @@ public class PathExecutor implements Helper {
return; return;
} }
// 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);
// however, descend doesn't request sprinting, beceause it doesn't know the context of what movement comes after it // however, descend doesn't request sprinting, beceause it doesn't know the context of what movement comes after it
Movement current = path.movements().get(pathPosition); Movement current = path.movements().get(pathPosition);
if (current instanceof MovementDescend && pathPosition < path.length() - 2) { if (current instanceof MovementDescend && pathPosition < path.length() - 2) {