From 67f5d222803b1d2ef515291ad574db11547e5954 Mon Sep 17 00:00:00 2001 From: Brady Date: Mon, 6 Aug 2018 20:25:46 -0500 Subject: [PATCH] Change isFlowing parameter to BlockPos for 1.13 changes --- .../java/baritone/bot/pathing/movement/MovementHelper.java | 2 +- src/main/java/baritone/bot/utils/BlockStateInterface.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/baritone/bot/pathing/movement/MovementHelper.java b/src/main/java/baritone/bot/pathing/movement/MovementHelper.java index 087edf14..435d3a7f 100644 --- a/src/main/java/baritone/bot/pathing/movement/MovementHelper.java +++ b/src/main/java/baritone/bot/pathing/movement/MovementHelper.java @@ -59,7 +59,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(state) || BlockStateInterface.isLiquid(pos.up())) { + if (BlockStateInterface.isFlowing(pos) || 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 9abab17d..db763ded 100644 --- a/src/main/java/baritone/bot/utils/BlockStateInterface.java +++ b/src/main/java/baritone/bot/utils/BlockStateInterface.java @@ -58,7 +58,9 @@ public class BlockStateInterface { return BlockStateInterface.getBlock(p) instanceof BlockLiquid; } - public static boolean isFlowing(IBlockState state) { + public static boolean isFlowing(BlockPos pos) { + // 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;