diff --git a/src/main/java/baritone/pathing/movement/MovementHelper.java b/src/main/java/baritone/pathing/movement/MovementHelper.java index 1036b69f..dc66d202 100644 --- a/src/main/java/baritone/pathing/movement/MovementHelper.java +++ b/src/main/java/baritone/pathing/movement/MovementHelper.java @@ -52,15 +52,14 @@ public interface MovementHelper extends ActionCosts, Helper { int x = pos.getX(); int y = pos.getY(); int z = pos.getZ(); - Block below = BlockStateInterface.get(x, y - 1, z).getBlock(); return b == Blocks.ICE // ice becomes water, and water can mess up the path || b instanceof BlockSilverfish // obvious reasons // call BlockStateInterface.get directly with x,y,z. no need to make 5 new BlockPos for no reason - || BlockStateInterface.get(x, y + 1, z) instanceof BlockLiquid//don't break anything touching liquid on any side - || BlockStateInterface.get(x + 1, y, z) instanceof BlockLiquid - || BlockStateInterface.get(x - 1, y, z) instanceof BlockLiquid - || BlockStateInterface.get(x, y, z + 1) instanceof BlockLiquid - || BlockStateInterface.get(x, y, z - 1) instanceof BlockLiquid; + || BlockStateInterface.get(x, y + 1, z).getBlock() instanceof BlockLiquid//don't break anything touching liquid on any side + || BlockStateInterface.get(x + 1, y, z).getBlock() instanceof BlockLiquid + || BlockStateInterface.get(x - 1, y, z).getBlock() instanceof BlockLiquid + || BlockStateInterface.get(x, y, z + 1).getBlock() instanceof BlockLiquid + || BlockStateInterface.get(x, y, z - 1).getBlock() instanceof BlockLiquid; } /** diff --git a/src/main/java/baritone/utils/ExampleBaritoneControl.java b/src/main/java/baritone/utils/ExampleBaritoneControl.java index 492c3652..c3eb40aa 100644 --- a/src/main/java/baritone/utils/ExampleBaritoneControl.java +++ b/src/main/java/baritone/utils/ExampleBaritoneControl.java @@ -314,6 +314,9 @@ public class ExampleBaritoneControl extends Behavior { if (msg.toLowerCase().equals("costs")) { Movement[] movements = AStarPathFinder.getConnectedPositions(new BetterBlockPos(playerFeet()), new CalculationContext()); List moves = new ArrayList<>(Arrays.asList(movements)); + while (moves.contains(null)) { + moves.remove(null); + } moves.sort(Comparator.comparingDouble(movement -> movement.getCost(new CalculationContext()))); for (Movement move : moves) { String[] parts = move.getClass().toString().split("\\.");