Examples of IStorageMonitorable


Examples of appeng.api.storage.IStorageMonitorable

    if (linked) {
      result = new LinkedHashMap<ItemIdentifier, Integer>();
    } else {
      result = new HashMap<ItemIdentifier, Integer>();
    }
    IStorageMonitorable tmp = tile.getMonitorable(dir, source);
    for (IAEItemStack items : tmp.getItemInventory().getStorageList()) {
      ItemIdentifier ident = ItemIdentifier.get(items.getItemStack());
      Integer count = result.get(ident);
      if (count != null) {
        result.put(ident, (int) (count + items.getStackSize() - (hideOnePerStack ? 1 : 0)));
      } else {
View Full Code Here

Examples of appeng.api.storage.IStorageMonitorable

  }

  @Override
  public Set<ItemIdentifier> getItems() {
    Set<ItemIdentifier> result = new TreeSet<ItemIdentifier>();
    IStorageMonitorable tmp = tile.getMonitorable(dir, source);
    for (IAEItemStack items : tmp.getItemInventory().getStorageList()) {
      ItemIdentifier ident = ItemIdentifier.get(items.getItemStack());
      result.add(ident);
    }
    return result;
  }
View Full Code Here

Examples of appeng.api.storage.IStorageMonitorable

    return result;
  }

  @Override
  public ItemStack getSingleItem(ItemIdentifier item) {
    IStorageMonitorable tmp = tile.getMonitorable(dir, source);
    IAEItemStack stack = AEApi.instance().storage().createItemStack(item.makeNormalStack(1));
    return tmp.getItemInventory().extractItems(stack, Actionable.MODULATE, source).getItemStack();
  }
View Full Code Here

Examples of appeng.api.storage.IStorageMonitorable

    return tmp.getItemInventory().extractItems(stack, Actionable.MODULATE, source).getItemStack();
  }

  @Override
  public ItemStack getMultipleItems(ItemIdentifier item, int count) {
    IStorageMonitorable tmp = tile.getMonitorable(dir, source);
    IAEItemStack stack = AEApi.instance().storage().createItemStack(item.makeNormalStack(count));
    return tmp.getItemInventory().extractItems(stack, Actionable.MODULATE, source).getItemStack();
  }
View Full Code Here

Examples of appeng.api.storage.IStorageMonitorable

    return tmp.getItemInventory().extractItems(stack, Actionable.MODULATE, source).getItemStack();
  }

  @Override
  public boolean containsItem(ItemIdentifier item) {
    IStorageMonitorable tmp = tile.getMonitorable(dir, source);
    IAEItemStack stack = AEApi.instance().storage().createItemStack(item.unsafeMakeNormalStack(1));
    return tmp.getItemInventory().extractItems(stack, Actionable.SIMULATE, source) != null;
  }
View Full Code Here

Examples of appeng.api.storage.IStorageMonitorable

    return tmp.getItemInventory().extractItems(stack, Actionable.SIMULATE, source) != null;
  }

  @Override
  public boolean containsUndamagedItem(ItemIdentifier item) {
    IStorageMonitorable tmp = tile.getMonitorable(dir, source);
    for (IAEItemStack items : tmp.getItemInventory().getStorageList()) {
      ItemIdentifier ident = ItemIdentifier.get(items.getItemStack());
      if (ident.equals(item)) {
        return true;
      }
    }
View Full Code Here

Examples of appeng.api.storage.IStorageMonitorable

    return roomForItem(item, item.getMaxStackSize());
  }

  @Override
  public int roomForItem(ItemIdentifier item, int count) {
    IStorageMonitorable tmp = tile.getMonitorable(dir, source);
    while (count > 0) {
      IAEItemStack stack = AEApi.instance().storage().createItemStack(item.makeNormalStack(count));
      if (tmp.getItemInventory().canAccept(stack)) {
        return count;
      }
      count--;
    }
    return 0;
View Full Code Here

Examples of appeng.api.storage.IStorageMonitorable

  @Override
  public ItemStack add(ItemStack stack, ForgeDirection from, boolean doAdd) {
    ItemStack st = stack.copy();
    IAEItemStack tst = AEApi.instance().storage().createItemStack(stack);

    IStorageMonitorable tmp = tile.getMonitorable(dir, source);
    IAEItemStack overflow = tmp.getItemInventory().injectItems(tst, Actionable.MODULATE, source);
    if (overflow != null) {
      st.stackSize -= overflow.getStackSize();
    }
    return st;
  }
View Full Code Here

Examples of appeng.api.storage.IStorageMonitorable

    if ( Platform.canAccess( gridProxy, src ) )
      return myInterface;

    final DualityInterface di = this;

    return new IStorageMonitorable() {

      @Override
      public IMEMonitor<IAEItemStack> getItemInventory()
      {
        return new InterfaceInventory( di );
View Full Code Here

Examples of appeng.api.storage.IStorageMonitorable

    }

    if ( te instanceof ITileStorageMonitorable )
    {
      ITileStorageMonitorable iface = (ITileStorageMonitorable) te;
      IStorageMonitorable sm = iface.getMonitorable( d, src );

      if ( channel == StorageChannel.ITEMS && sm != null )
      {
        IMEInventory<IAEItemStack> ii = sm.getItemInventory();
        if ( ii != null )
          return ii;
      }

      if ( channel == StorageChannel.FLUIDS && sm != null )
      {
        IMEInventory<IAEFluidStack> fi = sm.getFluidInventory();
        if ( fi != null )
          return fi;
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.