From e5e8eec2cf87a87cd6ba83be3beee2991f7bcf31 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 3 Aug 2019 12:55:20 +1000 Subject: [PATCH] SPIGOT-5241: setAttributeModifiers does not work on untouched stack --- .../java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java index d13a9f7293..e1d9952d39 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -999,8 +999,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { this.attributeModifiers = HashMultimap.create(); return; } - Iterator> iterator = attributeModifiers.entries().iterator(); + + checkAttributeList(); this.attributeModifiers.clear(); + + Iterator> iterator = attributeModifiers.entries().iterator(); while (iterator.hasNext()) { Map.Entry next = iterator.next();