SPIGOT-4551: Ignore invalid attribute modifier slots
This commit is contained in:
parent
dff66dfccd
commit
bd36e200da
@ -421,7 +421,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
EquipmentSlot slot = CraftEquipmentSlot.getSlot(EnumItemSlot.fromName(slotName.toLowerCase(Locale.ROOT)));
|
EquipmentSlot slot = null;
|
||||||
|
try {
|
||||||
|
slot = CraftEquipmentSlot.getSlot(EnumItemSlot.fromName(slotName.toLowerCase(Locale.ROOT)));
|
||||||
|
} catch (IllegalArgumentException ex) {
|
||||||
|
// SPIGOT-4551 - Slot is invalid, should really match nothing but this is undefined behaviour anyway
|
||||||
|
}
|
||||||
|
|
||||||
if (slot == null) {
|
if (slot == null) {
|
||||||
modifiers.put(attribute, attribMod);
|
modifiers.put(attribute, attribMod);
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user