Package net.minecraftforge.liquids

Examples of net.minecraftforge.liquids.ILiquidTank


      }
    }
    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++)
View Full Code Here


    int ret = 0;
    TileEntity te = world.getBlockTileEntity(x, y, z);
    if (te instanceof TileEntityFactoryInventory)
    {
      TileEntityFactoryInventory inv = (TileEntityFactoryInventory)te;
      ILiquidTank tank = inv.getTank();
      float tankPercent = 0, invPercent = 0;
      boolean hasTank = false, hasInventory = false;
      if (tank != null)
      {
        hasTank = true;
        if (tank.getLiquid() != null)
        {
          tankPercent = ((float)tank.getLiquid().amount) / tank.getCapacity();
        }
      }
      int[] accSlots = inv.getAccessibleSlotsFromSide(side);
      if (accSlots.length > 0)
      {
View Full Code Here

  @Override
  public void detectAndSendChanges()
  {
    super.detectAndSendChanges();
    int tankIndex = (int)(_crafter.worldObj.getWorldTime() % 9);
    ILiquidTank tank = _crafter.getTanks(ForgeDirection.UNKNOWN)[tankIndex];
    LiquidStack l = tank.getLiquid();
   
    for(int i = 0; i < crafters.size(); i++)
    {
      ((ICrafting)crafters.get(i)).sendProgressBarUpdate(this, 0, tankIndex);
      if(l != null)
View Full Code Here

TOP

Related Classes of net.minecraftforge.liquids.ILiquidTank

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.