SPIGOT-5241: setAttributeModifiers does not work on untouched stack

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2019-08-03 12:55:20 +10:00
parent c62558a09f
commit d67f427648

View file

@ -999,8 +999,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
this.attributeModifiers = HashMultimap.create(); this.attributeModifiers = HashMultimap.create();
return; return;
} }
Iterator<Map.Entry<Attribute, AttributeModifier>> iterator = attributeModifiers.entries().iterator();
checkAttributeList();
this.attributeModifiers.clear(); this.attributeModifiers.clear();
Iterator<Map.Entry<Attribute, AttributeModifier>> iterator = attributeModifiers.entries().iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
Map.Entry<Attribute, AttributeModifier> next = iterator.next(); Map.Entry<Attribute, AttributeModifier> next = iterator.next();