add getItemList method to grab an unmodifiablelist of registered

iteminfos.
This commit is contained in:
Nick Minkler 2014-01-20 20:19:40 -08:00
parent 43a5493628
commit 8d1f0f6bd2

View File

@ -16,6 +16,7 @@
package net.milkbowl.vault.item;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.regex.Matcher;
@ -28,6 +29,14 @@ public class Items {
private static final List<ItemInfo> items = new CopyOnWriteArrayList<ItemInfo>();
/**
* Returns the list of ItemInfo's registered in Vault as an UnmodifiableList.
* @return list of Items
*/
public static List<ItemInfo> getItemList() {
return Collections.unmodifiableList(items);
}
static {
items.add(new ItemInfo("Air", new String[][]{{"air"}}, Material.AIR));
items.add(new ItemInfo("Stone", new String[][]{{"ston"}, {"smoo", "sto"}}, Material.STONE));