use of icbm.classic.prefab.inventory.IInventoryProvider in project ICBM-Classic by BuiltBrokenModding.
the class BlockICBM method breakBlock.
@Override
public void breakBlock(World world, BlockPos pos, IBlockState state) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof IInventoryProvider && ((IInventoryProvider) tile).getInventory() != null) {
InventoryHelper.dropInventoryItems(world, pos, ((IInventoryProvider) tile).getInventory());
}
if (tile instanceof IMultiTileHost) {
// At this point the structure should already be dead if broken by a player
MultiBlockHelper.destroyMultiBlockStructure((IMultiTileHost) tile, false, true, false);
}
super.breakBlock(world, pos, state);
}
Aggregations