From 1024a1df2d0afdfe6be7bd2ed2ea97765a9bb436 Mon Sep 17 00:00:00 2001 From: leijurv Date: Mon, 20 Aug 2018 07:32:54 -0700 Subject: [PATCH] walk on lilypads --- .../baritone/bot/pathing/movement/MovementHelper.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/baritone/bot/pathing/movement/MovementHelper.java b/src/main/java/baritone/bot/pathing/movement/MovementHelper.java index ae3de8a9..572fad0d 100644 --- a/src/main/java/baritone/bot/pathing/movement/MovementHelper.java +++ b/src/main/java/baritone/bot/pathing/movement/MovementHelper.java @@ -69,14 +69,14 @@ public interface MovementHelper extends ActionCosts, Helper { static boolean canWalkThrough(BlockPos pos, IBlockState state) { Block block = state.getBlock(); - if (block instanceof BlockLilyPad - || block instanceof BlockFire + if (block instanceof BlockFire || block instanceof BlockTripWire || block instanceof BlockWeb || block instanceof BlockEndPortal) {//you can't actually walk through a lilypad from the side, and you shouldn't walk through fire return false; } - if (BlockStateInterface.isFlowing(state) || BlockStateInterface.isLiquid(pos.up())) { + IBlockState up = BlockStateInterface.get(pos.up()); + if (BlockStateInterface.isFlowing(state) || up.getBlock() instanceof BlockLiquid || up.getBlock() instanceof BlockLilyPad) { return false; // Don't walk through flowing liquids } if (block instanceof BlockDoor && !Blocks.IRON_DOOR.equals(block)) { @@ -153,7 +153,8 @@ public interface MovementHelper extends ActionCosts, Helper { return false; } if (BlockStateInterface.isWater(block)) { - return BlockStateInterface.isWater(pos.up()); // You can only walk on water if there is water above it + Block up = BlockStateInterface.get(pos.up()).getBlock(); + return BlockStateInterface.isWater(up) || up instanceof BlockLilyPad; // You can only walk on water if there is water above it } if (Blocks.MAGMA.equals(block)) { return false;