Package powercrystals.minefactoryreloaded.tile.base

Examples of powercrystals.minefactoryreloaded.tile.base.TileEntityFactoryInventory


  {
    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)
      {
        hasInventory = true;
        invPercent = inv.getComparatorOutput(side);
      }
      float mult = hasTank & hasInventory ? (tankPercent + invPercent) / 2 : hasTank ? tankPercent : hasInventory ? invPercent : 0f;
      ret = (int)Math.ceil(15 * mult);
    }
    return ret;
View Full Code Here

TOP

Related Classes of powercrystals.minefactoryreloaded.tile.base.TileEntityFactoryInventory

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.