@@ -77,7 +77,6 @@ public PathingCommand onTick(boolean calcFailed, boolean isSafeToCancel) {
7777 int curr = ctx .player ().getInventory ().items .stream ()
7878 .filter (stack -> filter .has (stack ))
7979 .mapToInt (ItemStack ::getCount ).sum ();
80- System .out .println ("Currently have " + curr + " valid items" );
8180 if (curr >= desiredQuantity ) {
8281 logDirect ("Have " + curr + " valid items" );
8382 cancel ();
@@ -119,7 +118,7 @@ public PathingCommand onTick(boolean calcFailed, boolean isSafeToCancel) {
119118 .filter (pos -> pos .getX () == ctx .playerFeet ().getX () && pos .getZ () == ctx .playerFeet ().getZ ())
120119 .filter (pos -> pos .getY () >= ctx .playerFeet ().getY ())
121120 .filter (pos -> !(BlockStateInterface .get (ctx , pos ).getBlock () instanceof AirBlock )) // after breaking a block, it takes mineGoalUpdateInterval ticks for it to actually update this list =(
122- .min (Comparator .comparingDouble (ctx .playerFeet ()::distSqr ));
121+ .min (Comparator .comparingDouble (ctx .playerFeet (). above () ::distSqr ));
123122 baritone .getInputOverrideHandler ().clearAllKeys ();
124123 if (shaft .isPresent () && ctx .player ().isOnGround ()) {
125124 BlockPos pos = shaft .get ();
@@ -486,7 +485,11 @@ public static boolean isNextToAir(CalculationContext ctx, BlockPos pos) {
486485
487486
488487 public static boolean plausibleToBreak (CalculationContext ctx , BlockPos pos ) {
489- if (MovementHelper .getMiningDurationTicks (ctx , pos .getX (), pos .getY (), pos .getZ (), ctx .bsi .get0 (pos ), true ) >= COST_INF ) {
488+ BlockState state = ctx .bsi .get0 (pos );
489+ if (MovementHelper .getMiningDurationTicks (ctx , pos .getX (), pos .getY (), pos .getZ (), state , true ) >= COST_INF ) {
490+ return false ;
491+ }
492+ if (MovementHelper .avoidBreaking (ctx .bsi , pos .getX (), pos .getY (), pos .getZ (), state )) {
490493 return false ;
491494 }
492495
0 commit comments