diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/core/Ext.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/core/Ext.kt index b369caf52..6387b3a8e 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/core/Ext.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/core/Ext.kt @@ -231,10 +231,12 @@ fun BlockState.getExplosionResistance(level: BlockGetter, pos: BlockPos): Float } fun Level.gracefulBlockBreak(blockPos: BlockPos, block: BlockState = getBlockState(blockPos)) { - block.onRemove(this, blockPos, Blocks.AIR.defaultBlockState(), false) - Block.dropResources(block, this, blockPos, getBlockEntity(blockPos)) + val tile = getBlockEntity(blockPos) + val state = block.fluidState.createLegacyBlock() + block.onRemove(this, blockPos, state, false) + Block.dropResources(block, this, blockPos, tile) block.block.destroy(this, blockPos, block) - setBlock(blockPos, block.fluidState.createLegacyBlock(), Block.UPDATE_ALL) + setBlock(blockPos, state, Block.UPDATE_ALL) } fun MutableCollection.addAll(elements: Iterator) {