From 0ba018388a324c83c52ffe7ff8b800c9690a7e96 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 8 Aug 2018 15:56:13 -0700 Subject: [PATCH] optim --- .../java/baritone/bot/pathing/movement/MovementHelper.java | 2 +- src/main/java/baritone/bot/utils/BlockStateInterface.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/baritone/bot/pathing/movement/MovementHelper.java b/src/main/java/baritone/bot/pathing/movement/MovementHelper.java index 08272112..1bf78439 100644 --- a/src/main/java/baritone/bot/pathing/movement/MovementHelper.java +++ b/src/main/java/baritone/bot/pathing/movement/MovementHelper.java @@ -83,7 +83,7 @@ public interface MovementHelper extends ActionCosts, Helper { || block instanceof BlockTripWire) {//you can't actually walk through a lilypad from the side, and you shouldn't walk through fire return false; } - if (BlockStateInterface.isFlowing(pos) || BlockStateInterface.isLiquid(pos.up())) { + if (BlockStateInterface.isFlowing(state) || BlockStateInterface.isLiquid(pos.up())) { return false; // Don't walk through flowing liquids } return block.isPassable(mc.world, pos); diff --git a/src/main/java/baritone/bot/utils/BlockStateInterface.java b/src/main/java/baritone/bot/utils/BlockStateInterface.java index 0e1c4c83..0ce26f6b 100644 --- a/src/main/java/baritone/bot/utils/BlockStateInterface.java +++ b/src/main/java/baritone/bot/utils/BlockStateInterface.java @@ -106,9 +106,8 @@ public class BlockStateInterface implements Helper { return BlockStateInterface.getBlock(p) instanceof BlockLiquid; } - public static boolean isFlowing(BlockPos pos) { + public static boolean isFlowing(IBlockState state) { // Will be IFluidState in 1.13 - IBlockState state = BlockStateInterface.get(pos); return state.getBlock() instanceof BlockLiquid && state.getPropertyKeys().contains(BlockLiquid.LEVEL) && state.getValue(BlockLiquid.LEVEL) != 0;