From 3bb16de67e3fef08aed510a6c03beabba1a2130d Mon Sep 17 00:00:00 2001 From: Leijurv Date: Tue, 20 Nov 2018 16:32:44 -0800 Subject: [PATCH] greatly increase mining visual scan range --- src/main/java/baritone/process/MineProcess.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/baritone/process/MineProcess.java b/src/main/java/baritone/process/MineProcess.java index 204e11c5..a0495ade 100644 --- a/src/main/java/baritone/process/MineProcess.java +++ b/src/main/java/baritone/process/MineProcess.java @@ -205,7 +205,7 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro /*public static List searchWorld(List mining, int max, World world) { }*/ - public static List searchWorld(IPlayerContext ctx, List mining, int max, List alreadyKnown) { + public static List searchWorld(IPlayerContext ctx, List mining, int max, List alreadyKnown) { List locs = new ArrayList<>(); List uninteresting = new ArrayList<>(); //long b = System.currentTimeMillis(); @@ -232,15 +232,16 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro public void addNearby() { knownOreLocations.addAll(droppedItemsScan(mining, ctx.world())); BlockPos playerFeet = ctx.playerFeet(); - int searchDist = 4; // why four? idk + BlockStateInterface bsi = new BlockStateInterface(ctx); + int searchDist = 10; + double fakedBlockReachDistance = 20; // at least 10 * sqrt(3) with some extra space to account for positioning within the block for (int x = playerFeet.getX() - searchDist; x <= playerFeet.getX() + searchDist; x++) { for (int y = playerFeet.getY() - searchDist; y <= playerFeet.getY() + searchDist; y++) { for (int z = playerFeet.getZ() - searchDist; z <= playerFeet.getZ() + searchDist; z++) { - BlockPos pos = new BlockPos(x, y, z); // crucial to only add blocks we can see because otherwise this // is an x-ray and it'll get caught - if (mining.contains(BlockStateInterface.getBlock(ctx, pos)) && RotationUtils.reachable(ctx.player(), pos, ctx.playerController().getBlockReachDistance()).isPresent()) { - knownOreLocations.add(pos); + if (mining.contains(bsi.get0(x, y, z).getBlock()) && RotationUtils.reachable(ctx.player(), new BlockPos(x, y, z), fakedBlockReachDistance).isPresent()) { + knownOreLocations.add(new BlockPos(x, y, z)); } } }