Examples of ItemIdentifier


Examples of logisticspipes.utils.item.ItemIdentifier

    return invUtil.getMultipleItems(wanteditem, Math.min(count, available));
  }

  private ItemStack extractFromIInventoryFiltered(IInventory inv, ItemIdentifierInventory filter, boolean isExcluded, int filterInvLimit) {
    IInventoryUtil invUtil = SimpleServiceLocator.inventoryUtilFactory.getInventoryUtil(inv);
    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);
View Full Code Here

Examples of net.mcft.copy.betterstorage.misc.ItemIdentifier

    return (isEnabled() ? getPileData().getContents().getRandomStacks() : Collections.EMPTY_LIST);
  }
 
  @Override
  public int getItemCount(ItemStack identifier) {
    return (isEnabled() ? getPileData().getContents().get(new ItemIdentifier(identifier)) : 0);
  }
View Full Code Here

Examples of net.mcft.copy.betterstorage.misc.ItemIdentifier

  public ItemStack insertItems(ItemStack stack) {
    return (isEnabled() ? getPileData().addItems(stack) : stack);
  }
  @Override
  public ItemStack extractItems(ItemStack identifier, int amount) {
    return (isEnabled() ? getPileData().removeItems(new ItemIdentifier(identifier), amount) : null);
  }
View Full Code Here

Examples of net.mcft.copy.betterstorage.misc.ItemIdentifier

    if (space > 0) {
     
      if (space < stack.stackSize)
        overflow = stack.splitStack(stack.stackSize - space);
     
      ItemIdentifier item = new ItemIdentifier(stack);
      getContents().set(item, getContents().get(item) + stack.stackSize);
     
      for (ICrateWatcher watcher : watchers)
        watcher.onCrateItemsModified(stack);
     
View Full Code Here

Examples of net.mcft.copy.betterstorage.misc.ItemIdentifier

  }
  /** Removes and returns a specific amount of items. <br>
   *  Returns less than the requested amount when there's
   *  not enough, or null if there's none at all. */
  public ItemStack removeItems(ItemStack stack) {
    return removeItems(new ItemIdentifier(stack), stack.stackSize);
  }
View Full Code Here

Examples of net.mcft.copy.betterstorage.misc.ItemIdentifier

    return space;
  }
  /** Returns how much space there is left for a specific item. */
  public int getSpaceForItem(ItemStack item) {
    if (item == null) return 0;
    return getSpaceForItem(new ItemIdentifier(item));
  }
View Full Code Here

Examples of net.mcft.copy.betterstorage.misc.ItemIdentifier

      int damage = stackCompound.getShort("Damage");
      ItemStack stack = new ItemStack(item, count, damage);
      if (stackCompound.hasKey("tag"))
        stack.stackTagCompound = stackCompound.getCompoundTag("tag");
      if (stack.getItem() != null)
        pileData.getContents().set(new ItemIdentifier(stack), stack.stackSize);
    }
    if (compound.hasKey("map"))
      pileData.map = CratePileMap.fromCompound(compound.getCompoundTag("map"));
    return pileData;
  }
View Full Code Here

Examples of net.mcft.copy.betterstorage.misc.ItemIdentifier

    data = new MapData();
    countData.put(item, data);
    return data;
  }
  private MapData getMapData(ItemStack item) {
    return getMapData(new ItemIdentifier(item));
  }
View Full Code Here

Examples of net.mcft.copy.betterstorage.misc.ItemIdentifier

  public void setInventorySlotContents(int slot, ItemStack stack) {
    if ((slot < 0) || (slot >= getSizeInventory())) return;
    ItemStack oldStack = getStackInSlot(slot);
    ignoreModifiedItems = true;
    if (oldStack != null) {
      ItemIdentifier item = new ItemIdentifier(oldStack);
      getMapData(item).itemCount -= oldStack.stackSize;
      data.removeItems(item, oldStack.stackSize);
    }
    if (stack != null) {
      int amount = Math.min(stack.stackSize,
View Full Code Here

Examples of net.mcft.copy.betterstorage.misc.ItemIdentifier

  public ItemStack decrStackSize(int slot, int amount) {
    ItemStack stack = getStackInSlot(slot);
    if (stack == null) return null;
    amount = Math.min(amount, stack.stackSize);
   
    ItemIdentifier item = new ItemIdentifier(stack);
    getMapData(item).itemCount -= amount;
   
    stack.stackSize -= amount;
    if (stack.stackSize <= 0)
      tempContents[slot] = null;
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.