Skip to content

Commit fd7bf9e

Browse files
Fix custom model data fields not copied in ItemBuilder#clone
1 parent 2135c0e commit fd7bf9e

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

invui/src/main/java/xyz/xenondevs/invui/item/ItemBuilder.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -854,8 +854,18 @@ public ItemBuilder clone() {
854854
try {
855855
ItemBuilder clone = ((ItemBuilder) super.clone());
856856
clone.itemStack = itemStack.clone();
857-
if (lore != null) clone.lore = new ArrayList<>(lore);
858-
if (modifiers != null) clone.modifiers = new ArrayList<>(modifiers);
857+
if (lore != null)
858+
clone.lore = new ArrayList<>(lore);
859+
if (customModelDataFloats != null)
860+
clone.customModelDataFloats = new FloatArrayList(customModelDataFloats);
861+
if (customModelDataBooleans != null)
862+
clone.customModelDataBooleans = new BooleanArrayList(customModelDataBooleans);
863+
if (customModelDataStrings != null)
864+
clone.customModelDataStrings = new ArrayList<>(customModelDataStrings);
865+
if (customModelDataColors != null)
866+
clone.customModelDataColors = new ArrayList<>(customModelDataColors);
867+
if (modifiers != null)
868+
clone.modifiers = new ArrayList<>(modifiers);
859869

860870
return clone;
861871
} catch (CloneNotSupportedException e) {

0 commit comments

Comments
 (0)