diff options
Diffstat (limited to 'src')
-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()]); + } } |