Package logisticspipes.utils.item

Examples of logisticspipes.utils.item.ItemIdentifierStack


  public ItemIdentifierStack getMaterials(int slotnr) {
    return _dummyInventory.getIDStackInSlot(slotnr);
  }

  public FluidIdentifier getFluidMaterial(int slotnr) {
    ItemIdentifierStack stack = _liquidInventory.getIDStackInSlot(slotnr);
    if(stack == null) return null;
    return FluidIdentifier.get(stack.getItem());
  }
View Full Code Here


  }
 
  private void removeExtras(int numToSend, ItemIdentifier item) {
    Iterator<LogisticsOrder> i = _extras.iterator();
    while(i.hasNext()){
      ItemIdentifierStack e = i.next().getItem();
      if(e.getItem().equals(item)) {
        if(numToSend >= e.getStackSize()) {
          numToSend -= e.getStackSize();
          i.remove();
          if(numToSend == 0) {
            return;
          }
        } else {
          e.setStackSize(e.getStackSize() - numToSend);
          break;
        }
      }
    }
  }
View Full Code Here

    ItemIdentifier wanteditem = null;
    for(ItemIdentifier item:invUtil.getItemsAndCount().keySet()) {
      if(isExcluded) {
        boolean found = false;
        for(int i=0;i<filter.getSizeInventory() && i < filterInvLimit;i++) {
          ItemIdentifierStack identStack = filter.getIDStackInSlot(i);
          if(identStack == null) continue;
          if(identStack.getItem().equalsWithoutNBT(item)) {
            found = true;
            break;
          }
        }
        if(!found) {
          wanteditem = item;
        }
      } else {
        boolean found = false;
        for(int i=0;i<filter.getSizeInventory() && i < filterInvLimit;i++) {
          ItemIdentifierStack identStack = filter.getIDStackInSlot(i);
          if(identStack == null) continue;
          if(identStack.getItem().equalsWithoutNBT(item)) {
            found = true;
            break;
          }
        }
        if(found) {
View Full Code Here

    if (_lostItems.isEmpty()) {
      return;
    }
    final Iterator<ItemIdentifierStack> iterator = _lostItems.iterator();
    while (iterator.hasNext()) {
      ItemIdentifierStack stack = iterator.next();
      int received = RequestTree.requestPartial(stack, (CoreRoutedPipe) container.pipe, null);
      if(received > 0) {
        if(received == stack.getStackSize()) {
          iterator.remove();
        } else {
          stack.setStackSize(stack.getStackSize() - received);
        }
      }
    }
  }
View Full Code Here

  public Set<ItemIdentifier> getSpecificInterests() {
    if(this.itemSinkModule.isDefaultRoute())
      return null;
    Set<ItemIdentifier> l1 = new TreeSet<ItemIdentifier>();
    for(int i=0; i<9;i++){
      ItemIdentifierStack item = this.itemSinkModule.getFilterInventory().getIDStackInSlot(i);
      if(item != null)
        l1.add(item.getItem());
    }
    return l1;
  }
View Full Code Here

        }
      }
    }
    TreeSet<ItemIdentifierStack> itemIdentifierStackList = new TreeSet<ItemIdentifierStack>();
    for(Entry<FluidIdentifier, Integer> item:allAvailableItems.entrySet()) {
      itemIdentifierStackList.add(new ItemIdentifierStack(item.getKey().getItemIdentifier(), item.getValue()));
    }
    return itemIdentifierStackList;
  }
View Full Code Here

TOP

Related Classes of logisticspipes.utils.item.ItemIdentifierStack

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.