ticks remaining in segment

This commit is contained in:
Leijurv 2018-08-15 17:29:45 -07:00
parent 28fd9581bc
commit 6be7786707
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -122,7 +122,7 @@ public class PathingBehavior extends Behavior {
// and this path dosen't get us all the way there
return;
}
if (current.getPath().ticksRemainingFrom(current.getPosition()) < Baritone.settings().planningTickLookAhead.get()) {
if (ticksRemainingInSegment().get() < Baritone.settings().planningTickLookAhead.get()) {
// and this path has 5 seconds or less left
displayChatMessageRaw("Path almost over. Planning ahead...");
findPathInNewThread(current.getPath().getDest(), false);
@ -131,6 +131,13 @@ public class PathingBehavior extends Behavior {
}
}
public Optional<Double> ticksRemainingInSegment() {
if (current == null) {
return Optional.empty();
}
return Optional.of(current.getPath().ticksRemainingFrom(current.getPosition()));
}
public void setGoal(Goal goal) {
this.goal = goal;
}