From 28ebf065ee4d178d3f7ed80cbe64bb7c64f7db21 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Tue, 18 Sep 2018 13:14:22 -0700 Subject: [PATCH] 5x harder to break while sneaking --- .../pathing/movement/movements/MovementPillar.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/baritone/pathing/movement/movements/MovementPillar.java b/src/main/java/baritone/pathing/movement/movements/MovementPillar.java index 512ff937..ccb5c280 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementPillar.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementPillar.java @@ -29,6 +29,7 @@ import baritone.utils.pathing.BetterBlockPos; import net.minecraft.block.*; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; +import net.minecraft.init.Blocks; import net.minecraft.util.math.BlockPos; public class MovementPillar extends Movement { @@ -102,7 +103,7 @@ public class MovementPillar extends Movement { return COST_INF; } if (ladder) { - return LADDER_UP_ONE_COST + hardness; + return LADDER_UP_ONE_COST + hardness * 5; } else { return JUMP_ONE_BLOCK_COST + context.placeBlockCost() + hardness; } @@ -205,4 +206,15 @@ public class MovementPillar extends Movement { return state; } + + @Override + protected boolean prepared(MovementState state) { + if (playerFeet().equals(src) || playerFeet().equals(src.down())) { + Block block = BlockStateInterface.getBlock(src.down()); + if (block == Blocks.LADDER || block == Blocks.VINE) { + state.setInput(InputOverrideHandler.Input.SNEAK, true); + } + } + return super.prepared(state); + } } \ No newline at end of file