public static void genericContainerRemoval(World var0, int var1, int var2, int var3)
    {
        IInventory var4 = (IInventory)var0.getBlockTileEntity(var1, var2, var3);

        if (var4 != null)
        {
            for (int var5 = 0; var5 < var4.getSizeInventory(); ++var5)
            {
                ItemStack var6 = var4.getStackInSlot(var5);

                if (var6 != null)
                {
                    double var7 = var0.rand.nextDouble() * 0.8D + 0.1D;
                    double var9 = var0.rand.nextDouble() * 0.8D + 0.1D;
                    EntityItem var14;

                    for (double var11 = var0.rand.nextDouble() * 0.8D + 0.1D; var6.stackSize > 0; var0.spawnEntityInWorld(var14))
                    {
                        int var13 = var0.rand.nextInt(21) + 10;

                        if (var13 > var6.stackSize)
                        {
                            var13 = var6.stackSize;
                        }

                        var6.stackSize -= var13;
                        var14 = new EntityItem(var0, (double)var1 + var7, (double)var2 + var9, (double)var3 + var11, new ItemStack(var6.itemID, var13, var6.getItemDamage()));
                        double var15 = 0.05D;
                        var14.motionX = var0.rand.nextGaussian() * var15;
                        var14.motionY = var0.rand.nextGaussian() * var15 + 0.2D;
                        var14.motionZ = var0.rand.nextGaussian() * var15;

                        if (var6.hasTagCompound())
                        {
                            var14.item.setTagCompound((NBTTagCompound)var6.getTagCompound().copy());
                        }
                    }

                    var4.setInventorySlotContents(var5, (ItemStack)null);
                }
            }
        }
    }