exploration chunk offset

This commit is contained in:
Leijurv 2019-04-19 15:10:10 -07:00
parent 7a2f26ef62
commit 2fcf9ace64
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 21 additions and 2 deletions

View File

@ -570,6 +570,13 @@ public final class Settings {
*/
public final Setting<Boolean> exploreForBlocks = new Setting<>(true);
/**
* While exploring the world, offset the closest unloaded chunk by this much in both axes.
* <p>
* This can result in more efficient loading, if you set this to the render distance.
*/
public final Setting<Integer> worldExploringChunkOffset = new Setting<>(0);
/**
* When the cache scan gives less blocks than the maximum threshold (but still above zero), scan the main world too.
* <p>

View File

@ -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()) {