From 5f674b86f8a3f8b26d2f0ea59bef80e5a7898381 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Mon, 16 Sep 2019 23:17:20 -0700 Subject: [PATCH] add a setting to scan a larger radius every tick --- src/api/java/baritone/api/Settings.java | 6 ++++++ src/main/java/baritone/process/BuilderProcess.java | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 55420e38..d0181366 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -757,6 +757,12 @@ public final class Settings { */ public final Setting 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 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)? */ diff --git a/src/main/java/baritone/process/BuilderProcess.java b/src/main/java/baritone/process/BuilderProcess.java index b924347c..310a7a8a 100644 --- a/src/main/java/baritone/process/BuilderProcess.java +++ b/src/main/java/baritone/process/BuilderProcess.java @@ -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;