diff --git a/src/main/java/baritone/behavior/PathingBehavior.java b/src/main/java/baritone/behavior/PathingBehavior.java index 0026e810..ad2df532 100644 --- a/src/main/java/baritone/behavior/PathingBehavior.java +++ b/src/main/java/baritone/behavior/PathingBehavior.java @@ -378,12 +378,15 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior, } public Optional estimatedTicksToGoal() { - if (goal == null) { + if (goal == null || ticksElapsedSoFar == 0) { return Optional.empty(); } BetterBlockPos currentPos = ctx.playerFeet(); double current = goal.heuristic(currentPos.x, currentPos.y, currentPos.z); double start = goal.heuristic(startPosition.x, startPosition.y, startPosition.z); + if (current == start) {//can't check above because current and start can be equal even if currentPos and startPosition are not + return Optional.empty(); + } return Optional.of(current * ticksElapsedSoFar / (start - current)); }