mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-01-03 22:08:28 +00:00
Fix tab complete on /enchant failing on empty key (#4215)
This commit is contained in:
parent
8e712bc827
commit
3abddd6f84
1 changed files with 4 additions and 1 deletions
|
@ -277,6 +277,9 @@ public final class Enchantments {
|
|||
}
|
||||
|
||||
public static Enchantment getByName(final String name) {
|
||||
if (name == null || name.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
Enchantment enchantment = null;
|
||||
if (isFlat) { // 1.13+ only
|
||||
enchantment = Enchantment.getByKey(NamespacedKey.minecraft(name.toLowerCase()));
|
||||
|
@ -287,7 +290,7 @@ public final class Enchantments {
|
|||
}
|
||||
if (enchantment == null) {
|
||||
enchantment = Enchantment.getByName(name.toLowerCase());
|
||||
}
|
||||
}
|
||||
if (enchantment == null) {
|
||||
enchantment = Enchantment.getByName(name);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue