diff --git a/src/api/java/baritone/api/process/PathingCommandType.java b/src/api/java/baritone/api/process/PathingCommandType.java index da64748a..af25591a 100644 --- a/src/api/java/baritone/api/process/PathingCommandType.java +++ b/src/api/java/baritone/api/process/PathingCommandType.java @@ -51,5 +51,10 @@ public enum PathingCommandType { *
* Cancel the current path if the goals are not equal */ - FORCE_REVALIDATE_GOAL_AND_PATH + FORCE_REVALIDATE_GOAL_AND_PATH, + + /** + * Go and ask the next process what to do + */ + DEFER } diff --git a/src/main/java/baritone/process/BackfillProcess.java b/src/main/java/baritone/process/BackfillProcess.java index e2bb70da..c3461faa 100644 --- a/src/main/java/baritone/process/BackfillProcess.java +++ b/src/main/java/baritone/process/BackfillProcess.java @@ -87,7 +87,7 @@ public class BackfillProcess extends BaritoneProcessHelper { return new PathingCommand(null, PathingCommandType.REQUEST_PAUSE); } } - return null; // cede to other process + return new PathingCommand(null, PathingCommandType.DEFER); // cede to other process } public void amIBreakingABlockHMMMMMMM() { @@ -119,7 +119,7 @@ public class BackfillProcess extends BaritoneProcessHelper { @Override public void onLostControl() { - blocksToReplace = new HashMap<>(); + blocksToReplace.clear(); } @Override diff --git a/src/main/java/baritone/utils/PathingControlManager.java b/src/main/java/baritone/utils/PathingControlManager.java index 46b69ec2..92b66c49 100644 --- a/src/main/java/baritone/utils/PathingControlManager.java +++ b/src/main/java/baritone/utils/PathingControlManager.java @@ -199,11 +199,11 @@ public class PathingControlManager implements IPathingControlManager { PathingCommand exec = proc.onTick(Objects.equals(proc, inControlLastTick) && baritone.getPathingBehavior().calcFailedLastTick(), baritone.getPathingBehavior().isSafeToCancel()); if (exec == null) { - /*if (proc.isActive()) { - throw new IllegalStateException(proc.displayName() + " returned null PathingCommand"); + if (proc.isActive()) { + throw new IllegalStateException(proc.displayName() + " actively returned null PathingCommand"); } - proc.onLostControl();*/ - } else { + // no need to call onLostControl; they are reporting inactive. + } else if (exec.commandType != PathingCommandType.DEFER) { inControlThisTick = proc; if (!proc.isTemporary()) { iterator.forEachRemaining(IBaritoneProcess::onLostControl);