fix crouching

This commit is contained in:
Leijurv 2020-02-05 17:45:22 -08:00
parent f5380881f4
commit e03e251541
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
4 changed files with 4 additions and 4 deletions

View File

@ -176,7 +176,7 @@ public class MovementAscend extends Movement {
ticksWithoutPlacement++;
if (MovementHelper.attemptToPlaceABlock(state, baritone, dest.down(), false) == PlaceResult.READY_TO_PLACE) {
state.setInput(Input.SNEAK, true);
if (ctx.player().movementInput.field_228350_h_) {
if (ctx.player().isCrouching()) {
state.setInput(Input.CLICK_RIGHT, true);
}
}

View File

@ -251,7 +251,7 @@ public class MovementPillar extends Movement {
state.setInput(Input.JUMP, false); // breaking is like 5x slower when you're jumping
state.setInput(Input.CLICK_LEFT, true);
blockIsThere = false;
} else if (ctx.player().movementInput.field_228350_h_ && (ctx.isLookingAt(src.down()) || ctx.isLookingAt(src)) && ctx.player().getPositionVec().y > dest.getY() + 0.1) {
} else if (ctx.player().isCrouching() && (ctx.isLookingAt(src.down()) || ctx.isLookingAt(src)) && ctx.player().getPositionVec().y > dest.getY() + 0.1) {
state.setInput(Input.CLICK_RIGHT, true);
}
}

View File

@ -286,7 +286,7 @@ public class MovementTraverse extends Movement {
}
switch (p) {
case READY_TO_PLACE: {
if (ctx.player().movementInput.field_228350_h_ || Baritone.settings().assumeSafeWalk.value) {
if (ctx.player().isCrouching() || Baritone.settings().assumeSafeWalk.value) {
state.setInput(Input.CLICK_RIGHT, true);
}
return state;

View File

@ -445,7 +445,7 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
BetterBlockPos pos = toBreak.get().getA();
baritone.getLookBehavior().updateTarget(rot, true);
MovementHelper.switchToBestToolFor(ctx, bcc.get(pos));
if (ctx.player().movementInput.field_228350_h_) {
if (ctx.player().isCrouching()) {
// really horrible bug where a block is visible for breaking while sneaking but not otherwise
// so you can't see it, it goes to place something else, sneaks, then the next tick it tries to break
// and is unable since it's unsneaked in the intermediary tick