From 46a12754e9a104b47c17c3523f505d5e0d69f011 Mon Sep 17 00:00:00 2001 From: ZacSharp <68165024+ZacSharp@users.noreply.github.com> Date: Fri, 18 Sep 2020 23:24:47 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9BReset=20ETA=20and=20return=200=20if?= =?UTF-8?q?=20we=20are=20already=20there=20not=20doing=20this=20caused=20a?= =?UTF-8?q?=20continuously=20increasing=20ETA=20when=20standing=20inside?= =?UTF-8?q?=20a=20`GoalNear`=20from=20`FollowProcess`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/baritone/behavior/PathingBehavior.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/baritone/behavior/PathingBehavior.java b/src/main/java/baritone/behavior/PathingBehavior.java index 22513985..acda243a 100644 --- a/src/main/java/baritone/behavior/PathingBehavior.java +++ b/src/main/java/baritone/behavior/PathingBehavior.java @@ -378,7 +378,14 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior, } public Optional estimatedTicksToGoal() { - if (goal == null || ticksElapsedSoFar == 0) { + if (goal == null) { + return Optional.empty(); + } + if (goal.isInGoal(ctx.playerFeet())) { + resetEstimatedTicksToGoal(); + return Optional.of(0.0); + } + if (ticksElapsedSoFar == 0) { return Optional.empty(); } BetterBlockPos currentPos = ctx.playerFeet();