mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
Added Enchantment.values() for retrieving all enchantments
By: Nathan Adams <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
2aca23d84a
commit
159c512a9f
1 changed files with 9 additions and 0 deletions
|
@ -226,4 +226,13 @@ public abstract class Enchantment {
|
||||||
public static Enchantment getByName(String name) {
|
public static Enchantment getByName(String name) {
|
||||||
return byName.get(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…
Reference in a new issue