Skip to content

Commit 1a3d302

Browse files
committed
Clean up.
1 parent 8ee7a1e commit 1a3d302

File tree

2 files changed

+10
-29
lines changed

2 files changed

+10
-29
lines changed

src/main/java/baritone/pathing/movement/MovementHelper.java

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -669,32 +669,14 @@ static void moveTowardsWithoutRotation(IPlayerContext ctx, MovementState state,
669669
ctx.playerRotations());
670670
int selection = getSelection(blockRotation, ax, az);
671671
switch (selection) {
672-
case 0:
673-
state.setInput(Input.MOVE_FORWARD, true);
674-
break;
675-
case 1:
676-
state.setInput(Input.MOVE_BACK, true);
677-
break;
678-
case 2:
679-
state.setInput(Input.MOVE_LEFT, true);
680-
break;
681-
case 3:
682-
state.setInput(Input.MOVE_RIGHT, true);
683-
break;
684-
case 4:
685-
state.setInput(Input.MOVE_FORWARD, true).setInput(Input.MOVE_LEFT, true);
686-
break;
687-
case 5:
688-
state.setInput(Input.MOVE_FORWARD, true).setInput(Input.MOVE_RIGHT, true);
689-
break;
690-
case 6:
691-
state.setInput(Input.MOVE_BACK, true).setInput(Input.MOVE_LEFT, true);
692-
break;
693-
case 7:
694-
state.setInput(Input.MOVE_BACK, true).setInput(Input.MOVE_RIGHT, true);
695-
break;
696-
default:
697-
break;
672+
case 0 -> state.setInput(Input.MOVE_FORWARD, true);
673+
case 1 -> state.setInput(Input.MOVE_BACK, true);
674+
case 2 -> state.setInput(Input.MOVE_LEFT, true);
675+
case 3 -> state.setInput(Input.MOVE_RIGHT, true);
676+
case 4 -> state.setInput(Input.MOVE_FORWARD, true).setInput(Input.MOVE_LEFT, true);
677+
case 5 -> state.setInput(Input.MOVE_FORWARD, true).setInput(Input.MOVE_RIGHT, true);
678+
case 6 -> state.setInput(Input.MOVE_BACK, true).setInput(Input.MOVE_LEFT, true);
679+
case 7 -> state.setInput(Input.MOVE_BACK, true).setInput(Input.MOVE_RIGHT, true);
698680
}
699681
}
700682

@@ -706,7 +688,7 @@ private static int getSelection(Rotation blockRotation, float ax, float az) {
706688
float closestX = 100000;
707689
float closestZ = 100000;
708690
for (int i = 0; i < options.length; i++) {
709-
if (Math.abs(targetAx - options[i][0]) + Math.abs(targetAz - options[i][1]) < closestX + closestZ) {
691+
if (Mth.abs(targetAx - options[i][0]) + Mth.abs(targetAz - options[i][1]) < closestX + closestZ) {
710692
closestX = Math.abs(targetAx - options[i][0]);
711693
closestZ = Math.abs(targetAz - options[i][1]);
712694
selection = i;
@@ -715,7 +697,7 @@ private static int getSelection(Rotation blockRotation, float ax, float az) {
715697
return selection;
716698
}
717699

718-
private static float[] @NotNull [] getOptions(float ax, float az) {
700+
private static float[][] getOptions(float ax, float az) {
719701
boolean canSprint = Baritone.settings().allowSprint.value;
720702
return new float[][]{
721703
{canSprint ? ax * 1.3f : ax, canSprint ? az * 1.3f : az}, // W

src/main/java/baritone/pathing/movement/movements/MovementTraverse.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,6 @@ public MovementState updateState(MovementState state) {
354354
}
355355
MovementHelper.moveTowardsWithoutRotation(ctx, state, dest);
356356
return state;
357-
// 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
358357
}
359358
}
360359

0 commit comments

Comments
 (0)