be more tolerant of alternate movement inputs
This commit is contained in:
parent
46f8829951
commit
c0761c0eef
@ -25,7 +25,6 @@ import baritone.api.utils.input.Input;
|
|||||||
import baritone.behavior.Behavior;
|
import baritone.behavior.Behavior;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.settings.KeyBinding;
|
import net.minecraft.client.settings.KeyBinding;
|
||||||
import net.minecraft.util.MovementInput;
|
|
||||||
import net.minecraft.util.MovementInputFromOptions;
|
import net.minecraft.util.MovementInputFromOptions;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -111,14 +110,17 @@ public final class InputOverrideHandler extends Behavior implements IInputOverri
|
|||||||
}
|
}
|
||||||
blockBreakHelper.tick(isInputForcedDown(Input.CLICK_LEFT));
|
blockBreakHelper.tick(isInputForcedDown(Input.CLICK_LEFT));
|
||||||
|
|
||||||
MovementInput desired = inControl()
|
if (inControl()) {
|
||||||
? new PlayerMovementInput(this)
|
if (ctx.player().movementInput.getClass() != PlayerMovementInput.class) {
|
||||||
: new MovementInputFromOptions(Minecraft.getMinecraft().gameSettings);
|
ctx.player().movementInput = new PlayerMovementInput(this);
|
||||||
|
}
|
||||||
if (ctx.player().movementInput.getClass() != desired.getClass()) {
|
} else {
|
||||||
ctx.player().movementInput = desired; // only set it if it was previously incorrect
|
if (ctx.player().movementInput.getClass() == PlayerMovementInput.class) {
|
||||||
// gotta do it this way, or else it constantly thinks you're beginning a double tap W sprint lol
|
ctx.player().movementInput = new MovementInputFromOptions(Minecraft.getMinecraft().gameSettings);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// only set it if it was previously incorrect
|
||||||
|
// gotta do it this way, or else it constantly thinks you're beginning a double tap W sprint lol
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean inControl() {
|
private boolean inControl() {
|
||||||
|
Loading…
Reference in New Issue
Block a user