fix follow offset while at large x and z coordinates

This commit is contained in:
Leijurv 2018-09-18 20:59:48 -07:00
parent 28ebf065ee
commit ef55d86913
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -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();
}