mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-07 08:58:20 +01:00
Fixed a possible null for attributeSlot
This commit is contained in:
parent
01ff9e2123
commit
0f9a2b5b4f
@ -6,5 +6,22 @@ public enum AttributeSlot {
|
||||
FEET,
|
||||
LEGS,
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ public final class NBTUtils {
|
||||
break;
|
||||
}
|
||||
|
||||
final AttributeSlot attributeSlot = AttributeSlot.valueOf(slot.toUpperCase());
|
||||
final AttributeSlot attributeSlot = AttributeSlot.parse(slot.toUpperCase());
|
||||
// Wrong attribute slot, stop here
|
||||
|
||||
// Add attribute
|
||||
|
Loading…
Reference in New Issue
Block a user