diff --git a/src/main/java/baritone/bot/behavior/PathingBehavior.java b/src/main/java/baritone/bot/behavior/PathingBehavior.java index 8842f609..ed7e418c 100644 --- a/src/main/java/baritone/bot/behavior/PathingBehavior.java +++ b/src/main/java/baritone/bot/behavior/PathingBehavior.java @@ -1,11 +1,33 @@ package baritone.bot.behavior; +import baritone.bot.pathing.path.IPath; import baritone.bot.pathing.path.PathExecutor; -public class PathingBehavior extends Behavior{ - public static final PathingBehavior INSTANCE=new PathingBehavior(); - private PathingBehavior(){} +public class PathingBehavior extends Behavior { + public static final PathingBehavior INSTANCE = new PathingBehavior(); + + private PathingBehavior() { + } private PathExecutor current; + @Override + public void onTick() { + if (current == null) { + return; + } + current.onTick(); + if (current.failed() || current.finished()) { + current = null; + } + } + + public PathExecutor getExecutor() { + return current; + } + + public IPath getPath() { + return current.getPath(); + } + }