From 57c4f9e1033cad41353c4bc74cee158d2041025a Mon Sep 17 00:00:00 2001 From: Echocage Date: Mon, 27 Jun 2022 18:38:54 -0500 Subject: [PATCH] Undid previous change, updated to instead check the next and the next_next block --- src/main/java/baritone/pathing/path/PathExecutor.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/baritone/pathing/path/PathExecutor.java b/src/main/java/baritone/pathing/path/PathExecutor.java index 0ff113df..0ff7a3ac 100644 --- a/src/main/java/baritone/pathing/path/PathExecutor.java +++ b/src/main/java/baritone/pathing/path/PathExecutor.java @@ -385,7 +385,7 @@ public class PathExecutor implements IPathExecutor, Helper { return false; } - if (pathPosition < path.length() - 2) { + if (pathPosition < path.length() - 3) { IMovement next = path.movements().get(pathPosition + 1); if (next instanceof MovementAscend && current.getDirection().up().equals(next.getDirection().down())) { // a descend then an ascend in the same direction @@ -396,7 +396,8 @@ public class PathExecutor implements IPathExecutor, Helper { logDebug("Skipping descend to straight ascend"); return true; } - if (canSprintFromDescendInto(ctx, current, next)) { + if (canSprintFromDescendInto(ctx, current, next) && + canSprintFromDescendInto(ctx, next, path.movements().get(pathPosition + 2))) { if (ctx.playerFeet().equals(current.getDest())) { pathPosition++; onChangeInPathPosition(); @@ -536,12 +537,12 @@ public class PathExecutor implements IPathExecutor, Helper { } private static boolean canSprintFromDescendInto(IPlayerContext ctx, IMovement current, IMovement next) { - if (!MovementHelper.canWalkOn(ctx, current.getDest().add(current.getDirection()))) { - return false; - } if (next instanceof MovementDescend && next.getDirection().equals(current.getDirection())) { return true; } + if (!MovementHelper.canWalkOn(ctx, current.getDest().add(current.getDirection()))) { + return false; + } if (next instanceof MovementTraverse && next.getDirection().down().equals(current.getDirection())) { return true; }