force revalidate on control change

This commit is contained in:
Leijurv 2019-03-11 19:23:41 -07:00
parent 580af2ab06
commit 6b7aca3081
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -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();