mirror of
https://github.com/MilkBowl/Vault.git
synced 2024-11-23 11:05:48 +01:00
add getItemList method to grab an unmodifiablelist of registered
iteminfos.
This commit is contained in:
parent
43a5493628
commit
8d1f0f6bd2
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user