2018-08-05 03:19:32 +00:00
|
|
|
package baritone.bot.behavior;
|
|
|
|
|
2018-08-05 03:28:32 +00:00
|
|
|
import baritone.bot.pathing.path.IPath;
|
2018-08-05 03:25:05 +00:00
|
|
|
import baritone.bot.pathing.path.PathExecutor;
|
|
|
|
|
2018-08-05 03:28:32 +00:00
|
|
|
public class PathingBehavior extends Behavior {
|
|
|
|
public static final PathingBehavior INSTANCE = new PathingBehavior();
|
|
|
|
|
|
|
|
private PathingBehavior() {
|
|
|
|
}
|
2018-08-05 03:25:05 +00:00
|
|
|
|
|
|
|
private PathExecutor current;
|
|
|
|
|
2018-08-05 03:28:32 +00:00
|
|
|
@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();
|
|
|
|
}
|
|
|
|
|
2018-08-05 03:19:32 +00:00
|
|
|
}
|