5x harder to break while sneaking

This commit is contained in:
Leijurv 2018-09-18 13:14:22 -07:00
parent b47b813462
commit 28ebf065ee
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -29,6 +29,7 @@ import baritone.utils.pathing.BetterBlockPos;
import net.minecraft.block.*; import net.minecraft.block.*;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.init.Blocks;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
public class MovementPillar extends Movement { public class MovementPillar extends Movement {
@ -102,7 +103,7 @@ public class MovementPillar extends Movement {
return COST_INF; return COST_INF;
} }
if (ladder) { if (ladder) {
return LADDER_UP_ONE_COST + hardness; return LADDER_UP_ONE_COST + hardness * 5;
} else { } else {
return JUMP_ONE_BLOCK_COST + context.placeBlockCost() + hardness; return JUMP_ONE_BLOCK_COST + context.placeBlockCost() + hardness;
} }
@ -205,4 +206,15 @@ public class MovementPillar extends Movement {
return state; 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);
}
} }