From ef55d869136310684275eae40e4bc8690fe5a894 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Tue, 18 Sep 2018 20:59:48 -0700 Subject: [PATCH] fix follow offset while at large x and z coordinates --- src/main/java/baritone/behavior/FollowBehavior.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/baritone/behavior/FollowBehavior.java b/src/main/java/baritone/behavior/FollowBehavior.java index a9a829c3..21ebbbea 100644 --- a/src/main/java/baritone/behavior/FollowBehavior.java +++ b/src/main/java/baritone/behavior/FollowBehavior.java @@ -48,8 +48,14 @@ public final class FollowBehavior extends Behavior implements Helper { return; } // lol this is trashy but it works - GoalXZ g = GoalXZ.fromDirection(following.getPositionVector(), Baritone.settings().followOffsetDirection.get(), Baritone.settings().followOffsetDistance.get()); - PathingBehavior.INSTANCE.setGoal(new GoalNear(new BlockPos(g.getX(), following.posY, g.getZ()), Baritone.settings().followRadius.get())); + BlockPos pos; + if (Baritone.settings().followOffsetDistance.get() == 0) { + pos = following.getPosition(); + } else { + GoalXZ g = GoalXZ.fromDirection(following.getPositionVector(), Baritone.settings().followOffsetDirection.get(), Baritone.settings().followOffsetDistance.get()); + pos = new BlockPos(g.getX(), following.posY, g.getZ()); + } + PathingBehavior.INSTANCE.setGoal(new GoalNear(pos, Baritone.settings().followRadius.get())); PathingBehavior.INSTANCE.revalidateGoal(); PathingBehavior.INSTANCE.path(); }