diff --git a/src/main/java/baritone/pathing/movement/Movement.java b/src/main/java/baritone/pathing/movement/Movement.java index 5eba39aba..d3d86463d 100644 --- a/src/main/java/baritone/pathing/movement/Movement.java +++ b/src/main/java/baritone/pathing/movement/Movement.java @@ -270,6 +270,11 @@ public abstract class Movement implements Helper, MovementHelper { } else if (state.getStatus() == MovementStatus.PREPPING) { state.setStatus(MovementStatus.WAITING); } + + if (state.getStatus() == MovementStatus.WAITING) { + state.setStatus(MovementStatus.RUNNING); + } + return state; } diff --git a/src/main/java/baritone/pathing/movement/movements/MovementAscend.java b/src/main/java/baritone/pathing/movement/movements/MovementAscend.java index d666ff6a5..e79929bee 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementAscend.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementAscend.java @@ -123,14 +123,8 @@ public class MovementAscend extends Movement { super.updateState(state); // TODO incorporate some behavior from ActionClimb (specifically how it waited until it was at most 1.2 blocks away before starting to jump // for efficiency in ascending minimal height staircases, which is just repeated MovementAscend, so that it doesn't bonk its head on the ceiling repeatedly) - switch (state.getStatus()) { - case WAITING: - state.setStatus(MovementStatus.RUNNING); - case RUNNING: - break; - default: - return state; - } + if (state.getStatus() != MovementStatus.RUNNING) + return state; if (playerFeet().equals(dest)) { return state.setStatus(MovementStatus.SUCCESS); diff --git a/src/main/java/baritone/pathing/movement/movements/MovementDescend.java b/src/main/java/baritone/pathing/movement/movements/MovementDescend.java index 8ab66af15..86d9db995 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementDescend.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementDescend.java @@ -67,14 +67,8 @@ public class MovementDescend extends Movement { @Override public MovementState updateState(MovementState state) { super.updateState(state); - switch (state.getStatus()) { - case WAITING: - state.setStatus(MovementStatus.RUNNING); - case RUNNING: - break; - default: - return state; - } + if (state.getStatus() != MovementStatus.RUNNING) + return state; BlockPos playerFeet = playerFeet(); if (playerFeet.equals(dest)) { diff --git a/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java b/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java index b71909d1b..1a11295e4 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java @@ -119,14 +119,8 @@ public class MovementDiagonal extends Movement { @Override public MovementState updateState(MovementState state) { super.updateState(state); - switch (state.getStatus()) { - case WAITING: - state.setStatus(MovementState.MovementStatus.RUNNING); - case RUNNING: - break; - default: - return state; - } + if (state.getStatus() != MovementState.MovementStatus.RUNNING) + return state; if (playerFeet().equals(dest)) { state.setStatus(MovementState.MovementStatus.SUCCESS); diff --git a/src/main/java/baritone/pathing/movement/movements/MovementDownward.java b/src/main/java/baritone/pathing/movement/movements/MovementDownward.java index 135553996..3be854ad7 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementDownward.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementDownward.java @@ -60,14 +60,8 @@ public class MovementDownward extends Movement { @Override public MovementState updateState(MovementState state) { super.updateState(state); - switch (state.getStatus()) { - case WAITING: - state.setStatus(MovementState.MovementStatus.RUNNING); - case RUNNING: - break; - default: - return state; - } + if (state.getStatus() != MovementState.MovementStatus.RUNNING) + return state; if (playerFeet().equals(dest)) { state.setStatus(MovementState.MovementStatus.SUCCESS); diff --git a/src/main/java/baritone/pathing/movement/movements/MovementFall.java b/src/main/java/baritone/pathing/movement/movements/MovementFall.java index 40ff97f54..db3b997ab 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementFall.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementFall.java @@ -96,14 +96,8 @@ public class MovementFall extends Movement { @Override public MovementState updateState(MovementState state) { super.updateState(state); - switch (state.getStatus()) { - case WAITING: - state.setStatus(MovementStatus.RUNNING); - case RUNNING: - break; - default: - return state; - } + if (state.getStatus() != MovementStatus.RUNNING) + return state; BlockPos playerFeet = playerFeet(); Rotation targetRotation = null; diff --git a/src/main/java/baritone/pathing/movement/movements/MovementPillar.java b/src/main/java/baritone/pathing/movement/movements/MovementPillar.java index 481553fa5..6d5a1a056 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementPillar.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementPillar.java @@ -121,14 +121,8 @@ public class MovementPillar extends Movement { @Override public MovementState updateState(MovementState state) { super.updateState(state); - switch (state.getStatus()) { - case WAITING: - state.setStatus(MovementState.MovementStatus.RUNNING); - case RUNNING: - break; - default: - return state; - } + if (state.getStatus() != MovementState.MovementStatus.RUNNING) + return state; IBlockState fromDown = BlockStateInterface.get(src); boolean ladder = fromDown.getBlock() instanceof BlockLadder || fromDown.getBlock() instanceof BlockVine; diff --git a/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java b/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java index 12eda4312..b12088d96 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java @@ -125,14 +125,8 @@ public class MovementTraverse extends Movement { @Override public MovementState updateState(MovementState state) { super.updateState(state); - switch (state.getStatus()) { - case WAITING: - state.setStatus(MovementState.MovementStatus.RUNNING); - case RUNNING: - break; - default: - return state; - } + if (state.getStatus() != MovementState.MovementStatus.RUNNING) + return state; state.setInput(InputOverrideHandler.Input.SNEAK, false);