fix follow offset while at large x and z coordinates
This commit is contained in:
parent
28ebf065ee
commit
ef55d86913
@ -48,8 +48,14 @@ public final class FollowBehavior extends Behavior implements Helper {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// lol this is trashy but it works
|
// lol this is trashy but it works
|
||||||
GoalXZ g = GoalXZ.fromDirection(following.getPositionVector(), Baritone.settings().followOffsetDirection.get(), Baritone.settings().followOffsetDistance.get());
|
BlockPos pos;
|
||||||
PathingBehavior.INSTANCE.setGoal(new GoalNear(new BlockPos(g.getX(), following.posY, g.getZ()), Baritone.settings().followRadius.get()));
|
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.revalidateGoal();
|
||||||
PathingBehavior.INSTANCE.path();
|
PathingBehavior.INSTANCE.path();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user