Fix gracefulBlockBreak not calling onRemove
This commit is contained in:
parent
6d205b3b4a
commit
4dbf7cdc1c
@ -25,6 +25,7 @@ import net.minecraft.world.item.crafting.Ingredient
|
|||||||
import net.minecraft.world.level.BlockGetter
|
import net.minecraft.world.level.BlockGetter
|
||||||
import net.minecraft.world.level.Level
|
import net.minecraft.world.level.Level
|
||||||
import net.minecraft.world.level.block.Block
|
import net.minecraft.world.level.block.Block
|
||||||
|
import net.minecraft.world.level.block.Blocks
|
||||||
import net.minecraft.world.level.block.state.BlockState
|
import net.minecraft.world.level.block.state.BlockState
|
||||||
import net.minecraft.world.level.block.state.StateHolder
|
import net.minecraft.world.level.block.state.StateHolder
|
||||||
import net.minecraft.world.level.block.state.properties.Property
|
import net.minecraft.world.level.block.state.properties.Property
|
||||||
@ -230,6 +231,7 @@ fun BlockState.getExplosionResistance(level: BlockGetter, pos: BlockPos): Float
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun Level.gracefulBlockBreak(blockPos: BlockPos, block: BlockState = getBlockState(blockPos)) {
|
fun Level.gracefulBlockBreak(blockPos: BlockPos, block: BlockState = getBlockState(blockPos)) {
|
||||||
|
block.onRemove(this, blockPos, Blocks.AIR.defaultBlockState(), false)
|
||||||
Block.dropResources(block, this, blockPos, getBlockEntity(blockPos))
|
Block.dropResources(block, this, blockPos, getBlockEntity(blockPos))
|
||||||
block.block.destroy(this, blockPos, block)
|
block.block.destroy(this, blockPos, block)
|
||||||
setBlock(blockPos, block.fluidState.createLegacyBlock(), Block.UPDATE_ALL)
|
setBlock(blockPos, block.fluidState.createLegacyBlock(), Block.UPDATE_ALL)
|
||||||
|
Loading…
Reference in New Issue
Block a user