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
1 changed files with 9 additions and 0 deletions

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;
@ -27,6 +28,14 @@ import org.bukkit.inventory.ItemStack;
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));