World Edit's ItemType

Discussion in 'Plugin Development' started by Hydrosis, Dec 26, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Hydrosis

  2. Offline

    NinjaWAffles

    Whenever you see a static block of code, it is an initializer. It is called before anything else is called. You can think of it much like a class constructor. What sk89q is doing is running a for loop through all the items in the enum, specified above the static block, and for each item that is run through the loop, he's getting the ID from the item and putting it along with the item into a hashmap (named ids) ... then, after the item is put into the hashmap (id), he's going through the names specified in the item type and is then putting each of the names associated with the item type into another hashmap (named lookups).

    An example is posted below:
    • GOLD_RECORD(ItemID.GOLD_RECORD, "Gold Record", "goldrecord", "golddisc")
      • Red = Item ID
      • Green = Item Name
      • Pink = Item Lookup Name(s)
     
    Hydrosis likes this.
Thread Status:
Not open for further replies.

Share This Page