Merge pull request #4596 from cattyngmd/1.19.4-follow-target-max-distance

Added followTargetMaxDistance setting
This commit is contained in:
leijurv
2025-02-07 16:58:17 -08:00
committed by GitHub
2 changed files with 9 additions and 0 deletions

View File

@@ -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

View File

@@ -76,6 +76,10 @@ public final class FollowProcess extends BaritoneProcessHelper implements IFollo
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);
}