From 2a9795f4118a415264276c615895ece50c461030 Mon Sep 17 00:00:00 2001 From: Snownee <1850986885@qq.com> Date: Sat, 16 May 2020 01:44:58 +0800 Subject: [PATCH] Fix contraption blocks do not drop while replacing by bedrock --- .../components/contraptions/Contraption.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/Contraption.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/Contraption.java index d06f73f8a..a509f2ba8 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/Contraption.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/Contraption.java @@ -565,11 +565,15 @@ public abstract class Contraption { state = state.with(SawBlock.RUNNING, false); BlockState blockState = world.getBlockState(targetPos); - if (blockState.getBlockHardness(world, targetPos) == -1) - continue; - if (state.getCollisionShape(world, targetPos).isEmpty() - && !blockState.getCollisionShape(world, targetPos).isEmpty()) + if (blockState.getBlockHardness(world, targetPos) == -1 + || (state.getCollisionShape(world, targetPos).isEmpty() + && !blockState.getCollisionShape(world, targetPos).isEmpty())) { + if (targetPos.getY() == 0) + targetPos = targetPos.up(); + world.playEvent(2001, targetPos, Block.getStateId(state)); + Block.spawnDrops(state, world, targetPos, null); continue; + } world.destroyBlock(targetPos, true); world.setBlockState(targetPos, state, 3 | BlockFlags.IS_MOVING);