Ploughing bubbles

- Fixed Mechanical Plough breaking segments of a bubble column
This commit is contained in:
simibubi 2021-07-03 16:38:51 +02:00
parent 1b5f9e7944
commit 8fd4664ed8

View file

@ -8,6 +8,7 @@ import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.BubbleColumnBlock;
import net.minecraft.block.FarmlandBlock;
import net.minecraft.block.FlowingFluidBlock;
import net.minecraft.item.ItemStack;
@ -72,10 +73,15 @@ public class PloughMovementBehaviour extends BlockBreakingMovementBehaviour {
@Override
public boolean canBreak(World world, BlockPos breakingPos, BlockState state) {
if (world.getBlockState(breakingPos.down())
.getBlock() instanceof FarmlandBlock)
return false;
if (state.getBlock() instanceof FlowingFluidBlock)
return false;
if (state.getBlock() instanceof BubbleColumnBlock)
return false;
return state.getCollisionShape(world, breakingPos)
.isEmpty() && !(state.getBlock() instanceof FlowingFluidBlock)
&& !(world.getBlockState(breakingPos.down())
.getBlock() instanceof FarmlandBlock);
.isEmpty();
}
@Override