mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-01-03 22:08:28 +00:00
Add API to register enchantment names/aliases (#3669)
Co-authored-by: MD <1917406+md678685@users.noreply.github.com> Co-authored-by: JRoy <joshroy126@gmail.com>
This commit is contained in:
parent
a20d20574e
commit
2f45d3edf3
1 changed files with 16 additions and 0 deletions
|
@ -301,4 +301,20 @@ public final class Enchantments {
|
|||
public static Set<String> keySet() {
|
||||
return ENCHANTMENTS.keySet();
|
||||
}
|
||||
|
||||
public static void registerEnchantment(String name, Enchantment enchantment) {
|
||||
if (ENCHANTMENTS.containsKey(name) || ALIASENCHANTMENTS.containsKey(name)) {
|
||||
return;
|
||||
}
|
||||
|
||||
ENCHANTMENTS.put(name, enchantment);
|
||||
}
|
||||
|
||||
public static void registerAlias(String name, Enchantment enchantment) {
|
||||
if (ENCHANTMENTS.containsKey(name) || ALIASENCHANTMENTS.containsKey(name) || !ENCHANTMENTS.containsValue(enchantment)) {
|
||||
return;
|
||||
}
|
||||
|
||||
ALIASENCHANTMENTS.put(name, enchantment);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue