Package appeng.api.storage

Examples of appeng.api.storage.ICellInventory


public final class ConverterCellInventory implements Converter {
    @Override
    public void convert(final Object value, final Map<Object, Object> output) {
        if (value instanceof ICellInventory) {
            final ICellInventory cell = (ICellInventory) value;
            output.put("storedItemTypes", cell.getStoredItemTypes());
            output.put("storedItemCount", cell.getStoredItemCount());
            output.put("remainingItemCount", cell.getRemainingItemCount());
            output.put("remainingItemTypes", cell.getRemainingItemTypes());

            output.put("getTotalItemTypes", cell.getTotalItemTypes());
            output.put("getAvailableItems", cell.getAvailableItems(AEApi.instance().storage().createItemList()));

            output.put("totalBytes", cell.getTotalBytes());
            output.put("freeBytes", cell.getFreeBytes());
            output.put("usedBytes", cell.getUsedBytes());
            output.put("unusedItemCount", cell.getUnusedItemCount());
            output.put("canHoldNewItem", cell.canHoldNewItem());
            //output.put("getPreformattedItems",cell.getConfigInventory());

            output.put("fuzzyMode", cell.getFuzzyMode().toString());
            output.put("name", cell.getItemStack().getDisplayName());
        } else if (value instanceof ICellInventoryHandler) {
            convert(((ICellInventoryHandler) value).getCellInv(), output);
        }
    }
View Full Code Here


    IMEInventory<IAEItemStack> inventory = AEApi.instance().registries().cell().getCellInventory( i, null, StorageChannel.ITEMS );

    if ( inventory instanceof ICellInventoryHandler )
    {
      ICellInventoryHandler handler = (ICellInventoryHandler) inventory;
      ICellInventory cellInventory = handler.getCellInv();

      if (cellInventory != null)
      {
        l.add(cellInventory.getUsedBytes() + " " + GuiText.Of.getLocal() + " "
            + cellInventory.getTotalBytes() + " "
            + GuiText.BytesUsed.getLocal());
       
        l.add(cellInventory.getStoredItemTypes() + " " + GuiText.Of.getLocal()
            + " " + cellInventory.getTotalItemTypes() + " "
            + GuiText.Types.getLocal());
       
        if ( handler.isPreformatted() )
        {
          String List = (handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included
View Full Code Here

  }

  @Override
  public double cellIdleDrain(ItemStack is, IMEInventory handler)
  {
    ICellInventory inv = ((ICellInventoryHandler) handler).getCellInv();
    return inv.getIdleDrain();
  }
View Full Code Here

    IMEInventory<IAEItemStack> cdi = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.ITEMS );

    if ( cdi instanceof CellInventoryHandler )
    {
      ICellInventory cd = ((ICellInventoryHandler) cdi).getCellInv();
      if ( cd != null )
      {
        lines.add( cd.getUsedBytes() + " " + GuiText.Of.getLocal() + " " + cd.getTotalBytes() + " " + GuiText.BytesUsed.getLocal() );
        lines.add( cd.getStoredItemTypes() + " " + GuiText.Of.getLocal() + " " + cd.getTotalItemTypes() + " " + GuiText.Types.getLocal() );
      }
    }
  }
View Full Code Here

    IMEInventory<IAEItemStack> cdi = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.ITEMS );

    if ( cdi instanceof CellInventoryHandler )
    {
      ICellInventory cd = ((ICellInventoryHandler) cdi).getCellInv();
      if ( cd != null )
      {
        lines.add( cd.getUsedBytes() + " " + GuiText.Of.getLocal() + " " + cd.getTotalBytes() + " " + GuiText.BytesUsed.getLocal() );
        lines.add( cd.getStoredItemTypes() + " " + GuiText.Of.getLocal() + " " + cd.getTotalItemTypes() + " " + GuiText.Types.getLocal() );
      }
    }
  }
View Full Code Here

  }

  CellInventoryHandler(IMEInventory c) {
    super( c, StorageChannel.ITEMS );

    ICellInventory ci = getCellInv();
    if ( ci != null )
    {
      IItemList<IAEItemStack> priorityList = AEApi.instance().storage().createItemList();

      IInventory upgrades = ci.getUpgradesInventory();
      IInventory config = ci.getConfigInventory();
      FuzzyMode fzMode = ci.getFuzzyMode();

      boolean hasInverter = false;
      boolean hasFuzzy = false;

      for (int x = 0; x < upgrades.getSizeInventory(); x++)
View Full Code Here

    IMEInventory<IAEItemStack> cdi = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.ITEMS );

    if ( cdi instanceof CellInventoryHandler )
    {
      ICellInventory cd = ((ICellInventoryHandler) cdi).getCellInv();
      if ( cd != null )
      {
        lines.add( cd.getUsedBytes() + " " + GuiText.Of.getLocal() + " " + cd.getTotalBytes() + " " + GuiText.BytesUsed.getLocal() );
        lines.add( cd.getStoredItemTypes() + " " + GuiText.Of.getLocal() + " " + cd.getTotalItemTypes() + " " + GuiText.Types.getLocal() );
      }
    }
  }
View Full Code Here

TOP

Related Classes of appeng.api.storage.ICellInventory

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.