Package net.sf.l2j.gameserver.templates

Examples of net.sf.l2j.gameserver.templates.L2EtcItem


      }
    }
    for (Iterator<Integer> iter = _etcItems.keySet().iterator(); iter.hasNext();)
    {
      Integer id = iter.next();
      L2EtcItem item = _etcItems.get(id);
      if (item.getItemId() > highestId)
      {
        highestId = item.getItemId();
      }
    }

    // Create a FastLookUp Table called _allTemplates of size : value of the highest item ID
    if (Config.DEBUG) _log.fine("highest item id used:" + highestId);
    _allTemplates = new L2Item[highestId +1];

    // Insert armor item in Fast Look Up Table
    for (Iterator<Integer> iter = _armors.keySet().iterator(); iter.hasNext();)
    {
      Integer id = iter.next();
      L2Armor item = _armors.get(id);
      assert _allTemplates[id.intValue()] == null;
      _allTemplates[id.intValue()] = item;
    }

    // Insert weapon item in Fast Look Up Table
    for (Iterator<Integer> iter = _weapons.keySet().iterator(); iter.hasNext();)
    {
      Integer id = iter.next();
      L2Weapon item = _weapons.get(id);
      assert _allTemplates[id.intValue()] == null;
      _allTemplates[id.intValue()] = item;
    }

    // Insert etcItem item in Fast Look Up Table
    for (Iterator<Integer> iter = _etcItems.keySet().iterator(); iter.hasNext();)
    {
      Integer id = iter.next();
      L2EtcItem item = _etcItems.get(id);
      assert _allTemplates[id.intValue()] == null;
      _allTemplates[id.intValue()] = item;
    }
  }
View Full Code Here


        if (_currentItem.item != null) return;
        if (_currentItem.type instanceof L2ArmorType) _currentItem.item = new L2Armor(
            (L2ArmorType) _currentItem.type, _currentItem.set);
        else if (_currentItem.type instanceof L2WeaponType) _currentItem.item = new L2Weapon(
            (L2WeaponType) _currentItem.type, _currentItem.set);
        else if (_currentItem.type instanceof L2EtcItemType) _currentItem.item = new L2EtcItem(
            (L2EtcItemType) _currentItem.type, _currentItem.set);
        else throw new Error("Unknown item type " + _currentItem.type);
    }
View Full Code Here

        }
        if (list.size() == 0)
        {
            for (Item item : itemData.values())
            {
                list.add(new L2EtcItem((L2EtcItemType)item.type, item.set));
            }
        }
        return list;
    }
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.templates.L2EtcItem

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.