From 19b47d77e5f24e859bd327d94e9e0d081ab25fc6 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Sat, 15 Sep 2018 07:51:46 -0700 Subject: [PATCH] can still fall into water if assumeWalkOnWater is true --- .../pathing/movement/movements/MovementFall.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/baritone/pathing/movement/movements/MovementFall.java b/src/main/java/baritone/pathing/movement/movements/MovementFall.java index dbcde285..ccdae099 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementFall.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementFall.java @@ -60,7 +60,8 @@ public class MovementFall extends Movement { return COST_INF; // falling onto a half slab is really glitchy, and can cause more fall damage than we'd expect } double placeBucketCost = 0.0; - if (!BlockStateInterface.isWater(dest) && src.getY() - dest.getY() > context.maxFallHeightNoWater()) { + boolean destIsWater = BlockStateInterface.isWater(dest); + if (!destIsWater && src.getY() - dest.getY() > context.maxFallHeightNoWater()) { if (!context.hasWaterBucket()) { return COST_INF; } @@ -88,7 +89,14 @@ public class MovementFall extends Movement { // And falling through signs is possible, but they do have a mining duration, right? if (MovementHelper.getMiningDurationTicks(context, positionsToBreak[i], false) > 0) { //can't break while falling - return COST_INF; + + if (i != positionsToBreak.length - 1 || !destIsWater) { + // if we're checking the very last block to mine + // and it's water (so this is a water fall) + // don't consider the cost of "mining" it + // (if assumeWalkOnWater is true, water isn't canWalkThrough) + return COST_INF; + } } } return WALK_OFF_BLOCK_COST + FALL_N_BLOCKS_COST[positionsToBreak.length - 1] + placeBucketCost + frontThree;