From 169eb1d0a3515e536678f8a5ad5fbe56b7d0b28a Mon Sep 17 00:00:00 2001 From: Leijurv Date: Tue, 28 Aug 2018 11:57:31 -0700 Subject: [PATCH] more efficient check --- .../java/baritone/pathing/movement/MovementHelper.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/baritone/pathing/movement/MovementHelper.java b/src/main/java/baritone/pathing/movement/MovementHelper.java index 549ee621..79892bbe 100644 --- a/src/main/java/baritone/pathing/movement/MovementHelper.java +++ b/src/main/java/baritone/pathing/movement/MovementHelper.java @@ -93,10 +93,15 @@ public interface MovementHelper extends ActionCosts, Helper { return true; } } - IBlockState up = BlockStateInterface.get(pos.up()); - if (BlockStateInterface.isFlowing(state) || up.getBlock() instanceof BlockLiquid || up.getBlock() instanceof BlockLilyPad) { + if (BlockStateInterface.isFlowing(state)) { return false; // Don't walk through flowing liquids } + if (block instanceof BlockLiquid) { + IBlockState up = BlockStateInterface.get(pos.up()); + if (up.getBlock() instanceof BlockLiquid || up.getBlock() instanceof BlockLilyPad) { + return false; + } + } return block.isPassable(mc.world, pos); }