Make Baritone not look forward while bridging.

This commit is contained in:
Murat65536
2025-05-11 18:12:11 -04:00
parent 0fe8c628c7
commit 0378096340
2 changed files with 14 additions and 1 deletions

View File

@@ -658,6 +658,15 @@ public interface MovementHelper extends ActionCosts, Helper {
)).setInput(Input.MOVE_FORWARD, true);
}
static void alignBridge(IPlayerContext ctx, MovementState state, BlockPos dest) {
state.setTarget(new MovementTarget(
RotationUtils.calcRotationFromVec3d(VecUtils.getBlockPosCenter(dest),
ctx.playerHead(),
ctx.playerRotations()).withPitch(ctx.playerRotations().getPitch()),
false
)).setInput(Input.MOVE_BACK, true);
}
/**
* Returns whether or not the specified block is
* water, regardless of whether or not it is flowing.

View File

@@ -283,6 +283,7 @@ public class MovementTraverse extends Movement {
}
}
MovementHelper.moveTowards(ctx, state, against);
// MovementHelper.moveBackwards(ctx, state, against);
return state;
} else {
wasTheBridgeBlockAlwaysThere = false;
@@ -315,6 +316,7 @@ public class MovementTraverse extends Movement {
// but only if our attempted place is straight ahead
return state.setInput(Input.MOVE_FORWARD, true);
}
// return state.setInput(Input.MOVE_BACK, true);
} else if (ctx.playerRotations().isReallyCloseTo(state.getTarget().rotation)) {
// well i guess theres something in the way
return state.setInput(Input.CLICK_LEFT, true);
@@ -352,7 +354,9 @@ public class MovementTraverse extends Movement {
}
return state;
}
MovementHelper.moveTowards(ctx, state, positionsToBreak[0]);
// MovementHelper.moveTowards(ctx, state, positionsToBreak[0]);
// MovementHelper.moveTowardsBlock(ctx, state, positionsToBreak[0]);
MovementHelper.alignBridge(ctx, state, dest);
return state;
// TODO MovementManager.moveTowardsBlock(to); // move towards not look at because if we are bridging for a couple blocks in a row, it is faster if we dont spin around and walk forwards then spin around and place backwards for every block
}