diff options
author | Nathan Adams <dinnerbone@dinnerbone.com> | 2011-11-28 03:41:40 +0000 |
---|---|---|
committer | Nathan Adams <dinnerbone@dinnerbone.com> | 2011-11-28 03:42:16 +0000 |
commit | bbff94e90aaaf76fdf613a2c6034b84d491ef55d (patch) | |
tree | 6097eb0d3cfaaf6f236681d21a54c0f5765b7715 | |
parent | ee4a975998082b601cf7e1db00e64371cc81867c (diff) | |
download | bukkit-bbff94e90aaaf76fdf613a2c6034b84d491ef55d.tar bukkit-bbff94e90aaaf76fdf613a2c6034b84d491ef55d.tar.gz bukkit-bbff94e90aaaf76fdf613a2c6034b84d491ef55d.tar.lz bukkit-bbff94e90aaaf76fdf613a2c6034b84d491ef55d.tar.xz bukkit-bbff94e90aaaf76fdf613a2c6034b84d491ef55d.zip |
Added Enchantment.values() for retrieving all enchantments
-rw-r--r-- | src/main/java/org/bukkit/enchantments/Enchantment.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/enchantments/Enchantment.java b/src/main/java/org/bukkit/enchantments/Enchantment.java index 69615817..646334fc 100644 --- a/src/main/java/org/bukkit/enchantments/Enchantment.java +++ b/src/main/java/org/bukkit/enchantments/Enchantment.java @@ -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()]); + } } |