From d328438cf2266097ed3a707af30428073b967b53 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Mon, 3 Sep 2018 09:21:26 -0700 Subject: [PATCH] no falling onto half slab --- .../pathing/movement/movements/MovementFall.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/baritone/pathing/movement/movements/MovementFall.java b/src/main/java/baritone/pathing/movement/movements/MovementFall.java index 95509574..0cb9780a 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementFall.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementFall.java @@ -27,6 +27,8 @@ import baritone.pathing.movement.MovementState.MovementTarget; import baritone.utils.*; import net.minecraft.block.Block; import net.minecraft.block.BlockFalling; +import net.minecraft.block.BlockSlab; +import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; @@ -49,9 +51,15 @@ public class MovementFall extends Movement { if (fromDown == Blocks.LADDER || fromDown == Blocks.VINE) { return COST_INF; } - if (!MovementHelper.canWalkOn(dest.down())) { + IBlockState fallOnto = BlockStateInterface.get(dest.down()); + if (!MovementHelper.canWalkOn(dest.down(), fallOnto)) { return COST_INF; } + if (fallOnto.getBlock() instanceof BlockSlab) { + if (!((BlockSlab) fallOnto.getBlock()).isDouble() && fallOnto.getValue(BlockSlab.HALF) == BlockSlab.EnumBlockHalf.BOTTOM) { + 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()) { if (!context.hasWaterBucket()) {