mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
SPIGOT-4551: Ignore invalid attribute modifier slots
By: md_5 <git@md-5.net>
This commit is contained in:
parent
1471b6a942
commit
239b2828db
1 changed files with 7 additions and 1 deletions
|
@ -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…
Reference in a new issue