Skip to content

Commit

Permalink
Merge pull request #4596 from cattyngmd/1.19.4-follow-target-max-dist…
Browse files Browse the repository at this point in the history
…ance

Added followTargetMaxDistance setting
  • Loading branch information
leijurv authored Feb 8, 2025
2 parents a566853 + 64fdad4 commit 3c9f5b2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/api/java/baritone/api/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,11 @@ public final class Settings {
*/
public final Setting<Integer> followRadius = new Setting<>(3);

/**
* The maximum distance to the entity you're following
*/
public final Setting<Integer> followTargetMaxDistance = new Setting<>(0);

/**
* Turn this on if your exploration filter is enormous, you don't want it to check if it's done,
* and you are just fine with it just hanging on completion
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/baritone/process/FollowProcess.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ private boolean followable(Entity entity) {
if (entity.equals(ctx.player())) {
return false;
}
int maxDist = Baritone.settings().followTargetMaxDistance.value;
if (maxDist != 0 && entity.distanceToSqr(ctx.player()) > maxDist * maxDist) {
return false;
}
return ctx.entitiesStream().anyMatch(entity::equals);
}

Expand Down

0 comments on commit 3c9f5b2

Please sign in to comment.