add a setting to scan a larger radius every tick

This commit is contained in:
Leijurv 2019-09-16 23:17:20 -07:00
parent cccd61e050
commit 5f674b86f8
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 10 additions and 3 deletions

View File

@ -757,6 +757,12 @@ public final class Settings {
*/
public final Setting<Boolean> schematicOrientationZ = new Setting<>(false);
/**
* Distance to scan every tick for updates. Expanding this beyond player reach distance (i.e. setting it to 6 or above)
* is only necessary in very large schematics where rescanning the whole thing is costly.
*/
public final Setting<Integer> builderTickScanRadius = new Setting<>(5);
/**
* While mining, should it also consider dropped items of the correct type as a pathing destination (as well as ore blocks)?
*/

View File

@ -486,9 +486,10 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
private void recalcNearby(BuilderCalculationContext bcc) {
BetterBlockPos center = ctx.playerFeet();
for (int dx = -5; dx <= 5; dx++) {
for (int dy = -5; dy <= 5; dy++) {
for (int dz = -5; dz <= 5; dz++) {
int radius = Baritone.settings().builderTickScanRadius.value;
for (int dx = -radius; dx <= radius; dx++) {
for (int dy = -radius; dy <= radius; dy++) {
for (int dz = -radius; dz <= radius; dz++) {
int x = center.x + dx;
int y = center.y + dy;
int z = center.z + dz;