added maximum distance setting for FollowProcess

This commit is contained in:
cattyn
2024-12-28 14:29:05 +03:00
parent a5668532b1
commit 64fdad424f
2 changed files with 9 additions and 0 deletions

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