diff --git a/src/main/java/baritone/pathing/movement/MovementHelper.java b/src/main/java/baritone/pathing/movement/MovementHelper.java index 9fd1c75f..62a96a18 100644 --- a/src/main/java/baritone/pathing/movement/MovementHelper.java +++ b/src/main/java/baritone/pathing/movement/MovementHelper.java @@ -141,14 +141,18 @@ public interface MovementHelper extends ActionCosts, Helper { * canWalkThrough but also won't impede movement at all. so not including doors or fence gates (we'd have to right click), * not including water, and not including ladders or vines or cobwebs (they slow us down) * - * @param bsi Block State Interface to provide block state lookup - * @param x The block's x position - * @param y The block's y position - * @param z The block's z position + * @param context Calculation context to provide block state lookup + * @param x The block's x position + * @param y The block's y position + * @param z The block's z position * @return Whether or not the block at the specified position */ - static boolean fullyPassable(BlockStateInterface bsi, int x, int y, int z) { - return fullyPassable(bsi.world, bsi.isPassableBlockPos.setPos(x, y, z), bsi.get0(x, y, z)); + static boolean fullyPassable(CalculationContext context, int x, int y, int z) { + return fullyPassable( + context.bsi.world, + context.bsi.isPassableBlockPos.setPos(x, y, z), + context.bsi.get0(x, y, z) + ); } static boolean fullyPassable(IPlayerContext ctx, BlockPos pos) { diff --git a/src/main/java/baritone/pathing/movement/movements/MovementParkour.java b/src/main/java/baritone/pathing/movement/movements/MovementParkour.java index 7475182c..0477c85c 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementParkour.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementParkour.java @@ -69,7 +69,7 @@ public class MovementParkour extends Movement { int xDiff = dir.getXOffset(); int zDiff = dir.getZOffset(); - if (!MovementHelper.fullyPassable(context.bsi, x + xDiff, y, z + zDiff)) { + if (!MovementHelper.fullyPassable(context, x + xDiff, y, z + zDiff)) { // most common case at the top -- the adjacent block isn't air return; } @@ -81,13 +81,13 @@ public class MovementParkour extends Movement { if (MovementHelper.avoidWalkingInto(adj.getBlock()) && adj.getBlock() != Blocks.WATER && adj.getBlock() != Blocks.FLOWING_WATER) { // magma sucks return; } - if (!MovementHelper.fullyPassable(context.bsi, x + xDiff, y + 1, z + zDiff)) { + if (!MovementHelper.fullyPassable(context, x + xDiff, y + 1, z + zDiff)) { return; } - if (!MovementHelper.fullyPassable(context.bsi, x + xDiff, y + 2, z + zDiff)) { + if (!MovementHelper.fullyPassable(context, x + xDiff, y + 2, z + zDiff)) { return; } - if (!MovementHelper.fullyPassable(context.bsi, x, y + 2, z)) { + if (!MovementHelper.fullyPassable(context, x, y + 2, z)) { return; } IBlockState standingOn = context.get(x, y - 1, z); @@ -107,10 +107,10 @@ public class MovementParkour extends Movement { for (int i = 2; i <= maxJump; i++) { int destX = x + xDiff * i; int destZ = z + zDiff * i; - if (!MovementHelper.fullyPassable(context.bsi, destX, y + 1, destZ)) { + if (!MovementHelper.fullyPassable(context, destX, y + 1, destZ)) { return; } - if (!MovementHelper.fullyPassable(context.bsi, destX, y + 2, destZ)) { + if (!MovementHelper.fullyPassable(context, destX, y + 2, destZ)) { return; } IBlockState destInto = context.bsi.get0(destX, y, destZ); @@ -134,7 +134,7 @@ public class MovementParkour extends Movement { } return; } - if (!MovementHelper.fullyPassable(context.bsi, destX, y + 3, destZ)) { + if (!MovementHelper.fullyPassable(context, destX, y + 3, destZ)) { return; } }