mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-21 05:44:17 +00:00
Added Enchantment.values() for retrieving all enchantments
This commit is contained in:
parent
ee4a975998
commit
bbff94e90a
1 changed files with 9 additions and 0 deletions
|
@ -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()]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue