Added Enchantment.values() for retrieving all enchantments

This commit is contained in:
Nathan Adams
2011-11-28 03:41:40 +00:00
parent e1410a61c5
commit de848fe4c9

View File

@@ -226,4 +226,13 @@ public abstract class Enchantment {
public static Enchantment getByName(String name) {
return byName.get(name);
}
/**
* Gets an array of all the registered {@link Enchantment}s
*
* @return Array of enchantments
*/
public static Enchantment[] values() {
return byId.values().toArray(new Enchantment[byId.size()]);
}
}