meme for cached blocks that arent packed yet

This commit is contained in:
Leijurv 2019-04-17 23:25:55 -07:00
parent 26256e7155
commit b64154e3b3
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 8 additions and 5 deletions

View File

@ -570,6 +570,13 @@ public final class Settings {
*/ */
public final Setting<Boolean> exploreForBlocks = new Setting<>(true); public final Setting<Boolean> exploreForBlocks = new Setting<>(true);
/**
* When the cache scan gives less blocks than the maximum threshold (but still above zero), scan the main world too.
* <p>
* Only if you have a beefy CPU and automatically mine blocks that are in cache
*/
public final Setting<Boolean> extendCacheOnThreshold = new Setting<>(false);
/** /**
* Don't consider the next layer in builder until the current one is done * Don't consider the next layer in builder until the current one is done
*/ */

View File

@ -267,7 +267,6 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro
public static List<BlockPos> searchWorld(CalculationContext ctx, List<Block> mining, int max, List<BlockPos> alreadyKnown, List<BlockPos> blacklist) { public static List<BlockPos> searchWorld(CalculationContext ctx, List<Block> mining, int max, List<BlockPos> alreadyKnown, List<BlockPos> blacklist) {
List<BlockPos> locs = new ArrayList<>(); List<BlockPos> locs = new ArrayList<>();
List<Block> uninteresting = new ArrayList<>(); List<Block> uninteresting = new ArrayList<>();
//long b = System.currentTimeMillis();
for (Block m : mining) { for (Block m : mining) {
if (CachedChunk.BLOCKS_TO_KEEP_TRACK_OF.contains(m)) { if (CachedChunk.BLOCKS_TO_KEEP_TRACK_OF.contains(m)) {
// maxRegionDistanceSq 2 means adjacent directly or adjacent diagonally; nothing further than that // 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); locs = prune(ctx, locs, mining, max, blacklist);
//System.out.println("Scan of cached chunks took " + (System.currentTimeMillis() - b) + "ms"); if (locs.isEmpty() || (Baritone.settings().extendCacheOnThreshold.value && locs.size() < max)) {
if (locs.isEmpty()) {
uninteresting = mining; uninteresting = mining;
} }
if (!uninteresting.isEmpty()) { if (!uninteresting.isEmpty()) {
//long before = System.currentTimeMillis();
locs.addAll(WorldScanner.INSTANCE.scanChunkRadius(ctx.getBaritone().getPlayerContext(), uninteresting, max, 10, 32)); // maxSearchRadius is NOT sq 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); locs.addAll(alreadyKnown);
return prune(ctx, locs, mining, max, blacklist); return prune(ctx, locs, mining, max, blacklist);