mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-24 14:06:42 +01:00
Fix contraption blocks do not drop while replacing by bedrock
This commit is contained in:
parent
a4e7db5788
commit
2a9795f411
1 changed files with 8 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue