1
0
mirror of https://github.com/cabaletta/baritone synced 2024-12-22 15:04:12 +00:00

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
if (!new CalculationContext().canSprint()) {
Baritone.INSTANCE.getInputOverrideHandler().setInputForceState(InputOverrideHandler.Input.SPRINT,false);
player().setSprinting(false);
return;
}
@ -341,6 +342,9 @@ public class PathExecutor implements Helper {
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
Movement current = path.movements().get(pathPosition);
if (current instanceof MovementDescend && pathPosition < path.length() - 2) {