From d40418d344e9f7813560ef9e22059cf09653187f Mon Sep 17 00:00:00 2001 From: Leijurv Date: Tue, 4 Sep 2018 16:04:44 -0700 Subject: [PATCH] move updateState after calculateCost for consistency with every other movement --- .../movement/movements/MovementDiagonal.java | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java b/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java index 2bf8bdf1..b71909d1 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java @@ -50,29 +50,6 @@ public class MovementDiagonal extends Movement { super(start, end, new BlockPos[]{dir1, dir1.up(), dir2, dir2.up(), end, end.up()}); } - @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 (playerFeet().equals(dest)) { - state.setStatus(MovementState.MovementStatus.SUCCESS); - return state; - } - if (!BlockStateInterface.isLiquid(playerFeet())) { - state.setInput(InputOverrideHandler.Input.SPRINT, true); - } - MovementHelper.moveTowards(state, dest); - return state; - } - @Override protected double calculateCost(CalculationContext context) { Block fromDown = BlockStateInterface.get(src.down()).getBlock(); @@ -139,6 +116,29 @@ public class MovementDiagonal extends Movement { return multiplier * SQRT_2; } + @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 (playerFeet().equals(dest)) { + state.setStatus(MovementState.MovementStatus.SUCCESS); + return state; + } + if (!BlockStateInterface.isLiquid(playerFeet())) { + state.setInput(InputOverrideHandler.Input.SPRINT, true); + } + MovementHelper.moveTowards(state, dest); + return state; + } + @Override protected boolean prepared(MovementState state) { return true;