mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-07 08:58:20 +01:00
Revert AttributeSlot.parse(String string)
This commit is contained in:
parent
b842f07c3c
commit
12f0190f97
@ -6,22 +6,5 @@ public enum AttributeSlot {
|
||||
FEET,
|
||||
LEGS,
|
||||
CHEST,
|
||||
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;
|
||||
}
|
||||
}
|
||||
HEAD
|
||||
}
|
||||
|
@ -176,9 +176,12 @@ public final class NBTUtils {
|
||||
break;
|
||||
}
|
||||
|
||||
final AttributeSlot attributeSlot = AttributeSlot.parse(slot.toUpperCase());
|
||||
AttributeSlot attributeSlot = AttributeSlot.valueOf(slot.toUpperCase());
|
||||
// Wrong attribute slot, stop here
|
||||
|
||||
if (attributeSlot == null)
|
||||
attributeSlot = AttributeSlot.MAINHAND;
|
||||
|
||||
// Add attribute
|
||||
final ItemAttribute itemAttribute =
|
||||
new ItemAttribute(uuid, name, attribute, attributeOperation, value, attributeSlot);
|
||||
|
Loading…
Reference in New Issue
Block a user