mirror of
https://github.com/MilkBowl/Vault.git
synced 2025-02-17 04:41:41 +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;
|
package net.milkbowl.vault.item;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
@ -27,6 +28,14 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
public class Items {
|
public class Items {
|
||||||
|
|
||||||
private static final List<ItemInfo> items = new CopyOnWriteArrayList<ItemInfo>();
|
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 {
|
static {
|
||||||
items.add(new ItemInfo("Air", new String[][]{{"air"}}, Material.AIR));
|
items.add(new ItemInfo("Air", new String[][]{{"air"}}, Material.AIR));
|
||||||
|
Loading…
Reference in New Issue
Block a user