Fix enchantments for servers that don't namespace them (Fixes #897)

This commit is contained in:
RednedEpic 2020-07-11 19:52:20 -05:00
parent 5ceb4145ac
commit e7657c7d07

View file

@ -76,7 +76,7 @@ public enum Enchantment {
public static Enchantment getByJavaIdentifier(String javaIdentifier) {
for (Enchantment enchantment : Enchantment.values()) {
if (enchantment.javaIdentifier.equals(javaIdentifier)) {
if (enchantment.javaIdentifier.equals(javaIdentifier) || enchantment.name().toLowerCase(Locale.ENGLISH).equalsIgnoreCase(javaIdentifier)) {
return enchantment;
}
}