Fix potential mutability issue with CraftMetaItem copy constructor

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2024-06-15 07:03:03 +10:00
parent 1e6fb15514
commit 87c3fdad31

View file

@ -320,7 +320,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
} }
this.damage = meta.damage; this.damage = meta.damage;
this.maxDamage = meta.maxDamage; this.maxDamage = meta.maxDamage;
this.unhandledTags = meta.unhandledTags; this.unhandledTags.copy(meta.unhandledTags.build());
this.removedTags.addAll(meta.removedTags); this.removedTags.addAll(meta.removedTags);
this.persistentDataContainer.putAll(meta.persistentDataContainer.getRaw()); this.persistentDataContainer.putAll(meta.persistentDataContainer.getRaw());