Examples of Inventory


Examples of uk.co.thomasc.scrapbanktf.inventory.Inventory

    }
  }

  public void run() {
    synchronized (AutoScrap.lck) {
      final Inventory MyInventory = Inventory.fetchInventory(bot.steamClient.getSteamId().convertToLong(), false);
      if (MyInventory == null) {
        Util.printConsole("Could not fetch own inventory via Steam API! (AutoScrap)", bot, ConsoleColor.White, true);
      }
     
      metal.put(0, new ArrayList<Long>());
      metal.put(1, new ArrayList<Long>());
      metal.put(2, new ArrayList<Long>());

      final ResultSet result = Main.sql.selectQuery("SELECT schemaid, classid, (stock - COUNT(reservation.Id) + IF(highvalue=1 and stock - COUNT(reservation.Id) > 1,-2,0)) as stk FROM items LEFT JOIN reservation ON items.schemaid = reservation.itemid WHERE highvalue != 2 GROUP BY items.schemaid HAVING stk > 4");
      final Map<Integer, MutableInt> count = new HashMap<Integer, MutableInt>();
      final Map<Integer, Byte> classid = new HashMap<Integer, Byte>();
      final Map<Integer, MutableInt> scraped = new HashMap<Integer, MutableInt>();
      try {
        while (result.next()) {
          try {
            count.put(result.getInt("schemaid"), new MutableInt(result.getInt("stk")));
            classid.put(result.getInt("schemaid"), result.getByte("classid"));
            scraped.put(result.getInt("schemaid"), new MutableInt(0));
          } catch (final SQLException e) {
            e.printStackTrace();
          }
        }
      } catch (final SQLException e) {
        e.printStackTrace();
      }
      final Map<Byte, Long> otherid = new HashMap<Byte, Long>();

      for (final Long id : MyInventory.getItemIds()) {
        final Item item = MyInventory.getItem(id);

        if (count.containsKey(item.defIndex) && count.get(item.defIndex).get() > 4) {
          count.get(item.defIndex).decrement();
          if (otherid.containsKey(classid.get(item.defIndex))) {
            final Item item2 = MyInventory.getItem(otherid.get(classid.get(item.defIndex)));
            CraftResponseCallback callback = scrap(otherid.get(classid.get(item.defIndex)), id);
            if (callback != null) {
              for (long itemId : callback.getItems()) {
                metal.get(0).add(itemId);
              }
View Full Code Here

Examples of vee.Inventory

    this.setGender(GenderType.Female);
   
    this.setMapCharacter('h');
   
    // Inventory and Equipment creation
    this.inventory = new Inventory(BAG_SIZE);
    this.equipment = new EquippedItems();
   
    // Put some clothes on
    this.gearUp();
   
View Full Code Here

Examples of xk.xact.inventory.Inventory

  public boolean recentlyUpdated = true;


  public CraftPad(ItemStack stack, EntityPlayer player) {
    this.player = player;
    this.outputInv = new Inventory( 1, "outputInv" ) {
      @Override
      public void onInventoryChanged() {
        super.onInventoryChanged();
        updateState();
      }
    };
    this.gridInv = new Inventory( 9, "gridInv" ) {
      @Override
      public void onInventoryChanged() {
        super.onInventoryChanged();
        inventoryChanged = true;
        updateRecipe();
        updateState();
      }
    };
    this.chipInv = new Inventory( 1, "chipInv" ) {
      @Override
      public void onInventoryChanged() {
        super.onInventoryChanged();
        inventoryChanged = true;
        updateRecipe();
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.