From b64154e3b370a8e39c38428a68bef68a37b5cf63 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 17 Apr 2019 23:25:55 -0700 Subject: [PATCH] meme for cached blocks that arent packed yet --- src/api/java/baritone/api/Settings.java | 7 +++++++ src/main/java/baritone/process/MineProcess.java | 6 +----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 0892f28d..89dc6565 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); + /** + * When the cache scan gives less blocks than the maximum threshold (but still above zero), scan the main world too. + *

+ * Only if you have a beefy CPU and automatically mine blocks that are in cache + */ + public final Setting extendCacheOnThreshold = new Setting<>(false); + /** * Don't consider the next layer in builder until the current one is done */ diff --git a/src/main/java/baritone/process/MineProcess.java b/src/main/java/baritone/process/MineProcess.java index 5ace2130..bda8e446 100644 --- a/src/main/java/baritone/process/MineProcess.java +++ b/src/main/java/baritone/process/MineProcess.java @@ -267,7 +267,6 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro public static List searchWorld(CalculationContext ctx, List mining, int max, List alreadyKnown, List blacklist) { List locs = new ArrayList<>(); List uninteresting = new ArrayList<>(); - //long b = System.currentTimeMillis(); for (Block m : mining) { if (CachedChunk.BLOCKS_TO_KEEP_TRACK_OF.contains(m)) { // maxRegionDistanceSq 2 means adjacent directly or adjacent diagonally; nothing further than that @@ -277,14 +276,11 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro } } locs = prune(ctx, locs, mining, max, blacklist); - //System.out.println("Scan of cached chunks took " + (System.currentTimeMillis() - b) + "ms"); - if (locs.isEmpty()) { + if (locs.isEmpty() || (Baritone.settings().extendCacheOnThreshold.value && locs.size() < max)) { uninteresting = mining; } if (!uninteresting.isEmpty()) { - //long before = System.currentTimeMillis(); locs.addAll(WorldScanner.INSTANCE.scanChunkRadius(ctx.getBaritone().getPlayerContext(), uninteresting, max, 10, 32)); // maxSearchRadius is NOT sq - //System.out.println("Scan of loaded chunks took " + (System.currentTimeMillis() - before) + "ms"); } locs.addAll(alreadyKnown); return prune(ctx, locs, mining, max, blacklist);