Package logisticspipes.utils.item

Examples of logisticspipes.utils.item.ItemIdentifier$ItemIdentifierCleanupThread


      int itemData = itemNBT.getInteger("data");
      NBTTagCompound tag = null;
      if(itemNBT.hasKey("nbt")) {
        tag = itemNBT.getCompoundTag("nbt");
      }
      ItemIdentifier item = ItemIdentifier.get(Item.getItemById(itemID), itemData, tag);
      int amount = itemNBT.getInteger("amount");
      ItemIdentifierStack stack = new ItemIdentifierStack(item, amount);
      macroItems.add(stack);
    }
  }
View Full Code Here


   
    drawRect(guiLeft + 6, guiTop + 16, right - 12, bottom - 84, BasicGuiHelper.ConvertEnumToColor(Colors.MiddleGrey));
    drawRect(guiLeft + 6, bottom - 52, right - 12, bottom - 32, BasicGuiHelper.ConvertEnumToColor(Colors.DarkGrey));
   
    for(ItemIdentifierStack itemStack : diskProvider.getItemDisplay()._allItems) {
      ItemIdentifier item = itemStack.getItem();
      if(!itemSearched(item)) continue;
      ppi++;
     
      if (ppi <= 45 * pageAll) continue;
      if (ppi > 45 * (pageAll+1)) continue;
      ItemStack st = itemStack.unsafeMakeNormalStack();
      int x = guiLeft + 10 + panelxSize * column;
      int y = guiTop + 18 + panelySize * row;

      GL11.glDisable(2896 /*GL_LIGHTING*/);
     
            if(!super.hasSubGui()) {
        if (mouseX >= x && mouseX < x + panelxSize && mouseY >= y && mouseY < y + panelySize) {
          drawRect(x - 3, y - 1, x + panelxSize - 3, y + panelySize - 3, BasicGuiHelper.ConvertEnumToColor(Colors.Black));
          drawRect(x - 2, y - 0, x + panelxSize - 4, y + panelySize - 4, BasicGuiHelper.ConvertEnumToColor(Colors.DarkGrey));
         
          tooltip = new Object[]{mouseX + guiLeft,mouseY + guiTop,st, false};
        }
       
       
        if(mousePosX != 0 && mousePosY != 0) {
          if ((mousePosX >= x && mousePosX < x + panelxSize && mousePosY >= y && mousePosY < y + panelySize) || (mouseX >= x && mouseX < x + panelxSize && mouseY >= y && mouseY < y + panelySize && (wheeldown != 0 || wheelup != 0))) {
            boolean handled = false;
            for(ItemIdentifierStack stack:macroItems) {
              if(stack.getItem().equals(item)) {
                if(mousebutton == 0 || wheelup != 0) {
                  stack.setStackSize(stack.getStackSize() + (1 + (wheelup != 0 ? wheelup - 1: 0)));
                } else if(mousebutton == 1 || wheeldown != 0) {
                  stack.setStackSize(stack.getStackSize() - (1 + (wheeldown != 0 ? wheeldown - 1: 0)));
                  if(stack.getStackSize() <= 0) {
                    macroItems.remove(stack);
                  }
                }
                handled = true;
                break;
              }
            }
            if(!handled) {
              int i = 0;
              for(ItemIdentifierStack stack:macroItems) {
                if(item == stack.getItem() && item.itemDamage < stack.getItem().itemDamage) {
                  if(mousebutton == 0 || wheelup != 0) {
                    macroItems.add(i, item.makeStack(1 + (wheelup != 0 ? wheelup - 1: 0)));
                  } else if(mousebutton == 2) {
                    macroItems.add(i, item.makeStack(64));
                  }
                  handled = true;
                  break;
                }
                if(Item.getIdFromItem(item.item) < Item.getIdFromItem(stack.getItem().item)) {
                  if(mousebutton == 0 || wheelup != 0) {
                    macroItems.add(i, item.makeStack(1 + (wheelup != 0 ? wheelup - 1: 0)));
                  } else if(mousebutton == 2) {
                    macroItems.add(i, item.makeStack(64));
                  }
                  handled = true;
                  break;
                }
                i++;
              }
              if(!handled) {
                if(mousebutton == 0 || wheelup != 0) {
                  macroItems.addLast(item.makeStack(1 + (wheelup != 0 ? wheelup - 1: 0)));
                } else if(mousebutton == 2) {
                  macroItems.addLast(item.makeStack(64));
                }
              }
            }
            mousePosX = 0;
            mousePosY = 0;
          }
        }
            } 
      column++;
      if (column == 9){
        row++;
        column = 0;
      }
    }

    BasicGuiHelper.renderItemIdentifierStackListIntoGui(diskProvider.getItemDisplay()._allItems, this, pageAll, guiLeft + 10, guiTop + 18, 9, 45, panelxSize, panelySize, mc, false, false);

    ppi = 0;
    column = 0;
    row = 0;
   
    for(ItemIdentifierStack itemStack : macroItems) {
      ItemIdentifier item = itemStack.getItem();
      if(!itemSearched(item)) continue;
      ppi++;
     
      if (ppi <= 9 * pageMacro) continue;
      if (ppi > 9 * (pageMacro+1)) continue;
View Full Code Here

    } 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 {
        result.put(ident, (int) (items.getStackSize() - (hideOnePerStack ? 1 : 0)));
View Full Code Here

  @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

  @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;
      }
    }
    return false;
  }
View Full Code Here

  }
   
  private Map<ItemIdentifier, Integer> getItemsAndCount(boolean linked) {
    HashMap<ItemIdentifier, Integer> map = new HashMap<ItemIdentifier, Integer>((int)(_tile.getUniqueItems() * 1.5));
    for(ItemStack stack : _tile.getContents()) {
      ItemIdentifier itemId = ItemIdentifier.get(stack);
      int stackSize = stack.stackSize - (_hideOnePerStack?1:0);
      Integer m = map.get(itemId);
      if (m==null){
        map.put(itemId, stackSize);
      } else {
View Full Code Here

    if (!itemIdent.isDamageable()) {
      int count = _tile.getItemCount(itemIdent.unsafeMakeNormalStack(1));
      return (count > 0);
    }
    for(ItemStack stack : _tile.getContents()) {
      ItemIdentifier itemId = ItemIdentifier.get(stack).getUndamaged();
      if(itemId.equals(itemIdent)) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

    return dataIdent;
  }

  @Override
  public ItemStack add(ItemStack stack, ForgeDirection from, boolean doAdd) {
    ItemIdentifier itemIdent = ItemIdentifier.get(stack);
    ItemStack st = stack.copy();
    st.stackSize = 0;
    ItemIdentifierStack content = getContents();
    if(content == null) return st;
    if(!content.getItem().equals(itemIdent)) return st;

    if(!doAdd) {
      int space = _tile.getMaxItemCount() + 3 * itemIdent.getMaxStackSize() - content.getStackSize();
      st.stackSize = Math.max(Math.min(space, stack.stackSize), 0);
      return st;
    }

    //add to output slot first
View Full Code Here

      ItemIdentifierStack item = matrix.getIDStackInSlot(i);
      if(item == null) {
        toUse[i] = -1;
        continue;
      }
      ItemIdentifier ident = item.getItem();
      for(int j=0;j<inv.getSizeInventory();j++) {
        item = inv.getIDStackInSlot(j);
        if(item == null) continue;
        if(isFuzzy ? (testFuzzy(ident, item, i)) : ident.equalsForCrafting(item.getItem())) {
          if(item.getStackSize() > used[j]) {
            used[j]++;
            toUse[i] = j;
            continue outer;
          }
View Full Code Here

      OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240 / 1.0F, 240 / 1.0F);
      GL11.glDisable(GL11.GL_DEPTH_TEST);
      GL11.glDisable(GL11.GL_LIGHTING);

      for (ItemIdentifierStack itemIdentifierStack : _allItems) {
        ItemIdentifier item = itemIdentifierStack.getItem();
        if (!search.itemSearched(item))
          continue;
        ppi++;

        if (ppi <= 70 * page)
 
View Full Code Here

TOP

Related Classes of logisticspipes.utils.item.ItemIdentifier$ItemIdentifierCleanupThread

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.