diff --git a/src/main/java/baritone/pathing/path/PathExecutor.java b/src/main/java/baritone/pathing/path/PathExecutor.java index d73cd9ad..523b98b0 100644 --- a/src/main/java/baritone/pathing/path/PathExecutor.java +++ b/src/main/java/baritone/pathing/path/PathExecutor.java @@ -111,7 +111,7 @@ public class PathExecutor implements Helper { for (int j = pathPosition; j <= previousPos; j++) { path.movements().get(j).reset(); } - clearKeys(); + onChangeInPathPosition(); return false; } } @@ -122,7 +122,7 @@ public class PathExecutor implements Helper { } System.out.println("Double skip sundae"); pathPosition = i - 1; - clearKeys(); + onChangeInPathPosition(); return false; } } @@ -251,8 +251,7 @@ public class PathExecutor implements Helper { if (movementStatus == SUCCESS) { //System.out.println("Movement done, next path"); pathPosition++; - ticksOnCurrent = 0; - clearKeys(); + onChangeInPathPosition(); onTick(event); return true; } else { @@ -328,13 +327,14 @@ public class PathExecutor implements Helper { player().setSprinting(true); } pathPosition++; + // okay to skip clearKeys and / or onChangeInPathPosition here since this isn't possible to repeat, since it's asymmetric logDebug("Skipping descend to straight ascend"); return; } if (canSprintInto(current, next)) { if (playerFeet().equals(current.getDest())) { pathPosition++; - clearKeys(); + onChangeInPathPosition(); } if (!player().isSprinting()) { player().setSprinting(true); @@ -376,6 +376,11 @@ public class PathExecutor implements Helper { return false; } + private void onChangeInPathPosition() { + clearKeys(); + ticksOnCurrent = 0; + } + private static void clearKeys() { // i'm just sick and tired of this snippet being everywhere lol Baritone.INSTANCE.getInputOverrideHandler().clearAllKeys();