continuous pathfinding and clearing
This commit is contained in:
parent
6e0df6e9fd
commit
5cdacb4939
@ -29,6 +29,11 @@ public final class InputOverrideHandler implements Helper {
|
||||
*/
|
||||
private final Map<Integer, Boolean> keyCodeForceStateMap = new HashMap<>();
|
||||
|
||||
public final void clearAllKeys() {
|
||||
inputForceStateMap.clear();
|
||||
keyCodeForceStateMap.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether or not we are forcing down the specified {@link KeyBinding}.
|
||||
*
|
||||
|
@ -1,5 +1,6 @@
|
||||
package baritone.bot.behavior.impl;
|
||||
|
||||
import baritone.bot.Baritone;
|
||||
import baritone.bot.behavior.Behavior;
|
||||
import baritone.bot.event.events.ChatEvent;
|
||||
import baritone.bot.event.events.RenderEvent;
|
||||
@ -49,6 +50,8 @@ public class PathingBehavior extends Behavior {
|
||||
current.onTick(event);
|
||||
if (current.failed() || current.finished()) {
|
||||
current = null;
|
||||
if (!goal.isInGoal(playerFeet()))
|
||||
findPathInNewThread(playerFeet(), true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,6 +82,13 @@ public class PathingBehavior extends Behavior {
|
||||
event.cancel();
|
||||
return;
|
||||
}
|
||||
if (msg.toLowerCase().equals("cancel")) {
|
||||
current = null;
|
||||
Baritone.INSTANCE.getInputOverrideHandler().clearAllKeys();
|
||||
event.cancel();
|
||||
displayChatMessageRaw("ok canceled");
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user