From 2fcf9ace6403b515ee62e3d0e04250cae358cb4f Mon Sep 17 00:00:00 2001 From: Leijurv Date: Fri, 19 Apr 2019 15:10:10 -0700 Subject: [PATCH] exploration chunk offset --- src/api/java/baritone/api/Settings.java | 7 +++++++ .../java/baritone/process/ExploreProcess.java | 16 ++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 89dc6565..8fbc6b85 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -570,6 +570,13 @@ public final class Settings { */ public final Setting exploreForBlocks = new Setting<>(true); + /** + * While exploring the world, offset the closest unloaded chunk by this much in both axes. + *

+ * This can result in more efficient loading, if you set this to the render distance. + */ + public final Setting worldExploringChunkOffset = new Setting<>(0); + /** * When the cache scan gives less blocks than the maximum threshold (but still above zero), scan the main world too. *

diff --git a/src/main/java/baritone/process/ExploreProcess.java b/src/main/java/baritone/process/ExploreProcess.java index fa252f76..0b26887e 100644 --- a/src/main/java/baritone/process/ExploreProcess.java +++ b/src/main/java/baritone/process/ExploreProcess.java @@ -62,7 +62,6 @@ public class ExploreProcess extends BaritoneProcessHelper implements IExplorePro logDebug("awaiting region load from disk"); return new PathingCommand(null, PathingCommandType.REQUEST_PAUSE); } - System.out.println("Closest uncached: " + closestUncached); return new PathingCommand(new GoalComposite(closestUncached), PathingCommandType.FORCE_REVALIDATE_GOAL_AND_PATH); } @@ -90,7 +89,20 @@ public class ExploreProcess extends BaritoneProcessHelper implements IExplorePro }); return null; // we still need to load regions from disk in order to decide properly } - centers.add(new BlockPos(centerX, 0, centerZ)); + int offsetCenterX = centerX; + int offsetCenterZ = centerZ; + int offset = 16 * Baritone.settings().worldExploringChunkOffset.value; + if (dx < 0) { + offsetCenterX -= offset; + } else { + offsetCenterX += offset; + } + if (dz < 0) { + offsetCenterZ -= offset; + } else { + offsetCenterZ += offset; + } + centers.add(new BlockPos(offsetCenterX, 0, offsetCenterZ)); } } if (!centers.isEmpty()) {