no falling onto half slab
This commit is contained in:
parent
16f88aa858
commit
d328438cf2
@ -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()) {
|
||||
|
Loading…
Reference in New Issue
Block a user