worldObj.destroyBlock(x, y, z, false);
return true;
}
if (current != null)
{
FluidStack liquid = FluidContainerRegistry.getFluidForFilledItem(current);
TileEntityCertusTank tank = (TileEntityCertusTank) worldObj.getBlockTileEntity(x, y, z);
if (liquid != null)
{
int amountFilled = tank.fill(ForgeDirection.UNKNOWN, liquid, true);
if (amountFilled != 0 && !entityplayer.capabilities.isCreativeMode)
{
if (current.stackSize > 1)
{
entityplayer.inventory.mainInventory[entityplayer.inventory.currentItem].stackSize -= 1;
entityplayer.inventory.addItemStackToInventory(current.getItem().getContainerItemStack(current));
} else
{
entityplayer.inventory.mainInventory[entityplayer.inventory.currentItem] = current.getItem().getContainerItemStack(current);
}
}
return true;
// Handle empty containers
} else
{
FluidStack available = tank.getTankInfo(ForgeDirection.UNKNOWN)[0].fluid;
if (available != null)
{
ItemStack filled = FluidContainerRegistry.fillFluidContainer(available, current);
liquid = FluidContainerRegistry.getFluidForFilledItem(filled);
if (liquid != null)
{
if (!entityplayer.capabilities.isCreativeMode)
{
if (current.stackSize > 1)
{
if (!entityplayer.inventory.addItemStackToInventory(filled))
{
tank.fill(ForgeDirection.UNKNOWN, new FluidStack(liquid, liquid.amount), true);
return false;
} else
{
entityplayer.inventory.mainInventory[entityplayer.inventory.currentItem].stackSize -= 1;
}