Merge pull request #4596 from cattyngmd/1.19.4-follow-target-max-distance
Added followTargetMaxDistance setting
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user