From 6b7aca308191f33925c05ebea196b9c1fb863161 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Mon, 11 Mar 2019 19:23:41 -0700 Subject: [PATCH] force revalidate on control change --- src/main/java/baritone/utils/PathingControlManager.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/baritone/utils/PathingControlManager.java b/src/main/java/baritone/utils/PathingControlManager.java index a01a1036..addcc791 100644 --- a/src/main/java/baritone/utils/PathingControlManager.java +++ b/src/main/java/baritone/utils/PathingControlManager.java @@ -24,6 +24,7 @@ import baritone.api.pathing.calc.IPathingControlManager; import baritone.api.pathing.goals.Goal; import baritone.api.process.IBaritoneProcess; import baritone.api.process.PathingCommand; +import baritone.api.process.PathingCommandType; import baritone.behavior.PathingBehavior; import baritone.pathing.path.PathExecutor; import net.minecraft.util.math.BlockPos; @@ -91,6 +92,11 @@ public class PathingControlManager implements IPathingControlManager { p.secretInternalSetGoal(null); return; } + if (inControlThisTick != inControlLastTick && command.commandType != PathingCommandType.REQUEST_PAUSE) { + // if control has changed, and the new process wants to do something + p.cancelSegmentIfSafe(); + // get rid of the in progress stuff from the last process + } switch (command.commandType) { case REQUEST_PAUSE: p.requestPause();