Revert AttributeSlot.parse(String string)

This commit is contained in:
ALS 2021-02-21 16:56:06 +01:00
parent b842f07c3c
commit 12f0190f97
2 changed files with 5 additions and 19 deletions

View File

@ -6,22 +6,5 @@ public enum AttributeSlot {
FEET, FEET,
LEGS, LEGS,
CHEST, CHEST,
HEAD; HEAD
public static AttributeSlot parse(String string) {
switch (string.toUpperCase()) {
case "OFFHAND":
return OFFHAND;
case "FEET":
return FEET;
case "LEGS":
return LEGS;
case "CHEST":
return CHEST;
case "HEAD":
return HEAD;
default:
return MAINHAND;
}
}
} }

View File

@ -176,9 +176,12 @@ public final class NBTUtils {
break; break;
} }
final AttributeSlot attributeSlot = AttributeSlot.parse(slot.toUpperCase()); AttributeSlot attributeSlot = AttributeSlot.valueOf(slot.toUpperCase());
// Wrong attribute slot, stop here // Wrong attribute slot, stop here
if (attributeSlot == null)
attributeSlot = AttributeSlot.MAINHAND;
// Add attribute // Add attribute
final ItemAttribute itemAttribute = final ItemAttribute itemAttribute =
new ItemAttribute(uuid, name, attribute, attributeOperation, value, attributeSlot); new ItemAttribute(uuid, name, attribute, attributeOperation, value, attributeSlot);