}
}
onFactoryInventoryChanged();
boolean foundLiquid = false;
ILiquidTank tank = getTank();
int tankAmount = nbttagcompound.getInteger("tankAmount");
if (tank != null && nbttagcompound.hasKey("tankFluidName"))
{
LiquidStack fluid = LiquidDictionary.getLiquid(nbttagcompound.getString("tankFluidName"), tankAmount);
if (fluid != null)
{
if(fluid.amount > tank.getCapacity())
{
fluid.amount = tank.getCapacity();
}
((LiquidTank)tank).setLiquid(fluid);
foundLiquid = true;
}
}
if (!foundLiquid)
{
int tankItemId = nbttagcompound.getInteger("tankItemId");
int tankItemMeta = nbttagcompound.getInteger("tankItemMeta");
if(tank != null && Item.itemsList[tankItemId] != null && LiquidContainerRegistry.isLiquid(new ItemStack(tankItemId, 1, tankItemMeta)))
{
((LiquidTank)tank).setLiquid(new LiquidStack(tankItemId, tankAmount, tankItemMeta));
if(tank.getLiquid() != null && tank.getLiquid().amount > tank.getCapacity())
{
tank.getLiquid().amount = tank.getCapacity();
}
}
}
for(int i = 0; i < getSizeInventory(); i++)