use of com.codetaylor.mc.athenaeum.tile.IContainer in project artisan-worktables by codetaylor.
the class BlockBase method breakBlock.
@Override
public void breakBlock(World world, BlockPos pos, IBlockState state) {
if (!world.isRemote) {
List<TileEntityBase> joinedTables = Util.getJoinedTables(new ArrayList<>(), world, pos, null);
for (TileEntityBase table : joinedTables) {
table.onJoinedBlockBreak(pos);
}
}
TileEntity tileEntity = world.getTileEntity(pos);
if (tileEntity instanceof IContainer) {
List<ItemStack> drops = ((IContainer) tileEntity).getBlockBreakDrops();
if (!(tileEntity instanceof TileEntityBase) || !((TileEntityBase) tileEntity).isCreative()) {
for (ItemStack drop : drops) {
InventoryHelper.spawnItemStack(world, pos.getX(), pos.getY(), pos.getZ(), drop);
}
}
}
super.breakBlock(world, pos, state);
}
Aggregations