add force cancel

This commit is contained in:
Leijurv
2018-09-01 14:45:57 -07:00
parent 8d46c36269
commit e705f9808b
2 changed files with 13 additions and 0 deletions

View File

@@ -28,6 +28,7 @@ import baritone.chunk.ChunkPacker;
import baritone.chunk.Waypoint;
import baritone.chunk.WorldProvider;
import baritone.pathing.calc.AStarPathFinder;
import baritone.pathing.calc.AbstractNodeCostSearch;
import baritone.pathing.goals.*;
import baritone.pathing.movement.ActionCosts;
import baritone.pathing.movement.CalculationContext;
@@ -117,6 +118,12 @@ public class ExampleBaritoneControl extends Behavior {
displayChatMessageRaw("ok canceled");
return;
}
if (msg.toLowerCase().equals("forcecancel")) {
AbstractNodeCostSearch.forceCancel();
event.cancel();
displayChatMessageRaw("ok force canceled");
return;
}
if (msg.toLowerCase().equals("invert")) {
Goal goal = PathingBehavior.INSTANCE.getGoal();
BlockPos runAwayFrom;