From 6d270af78c5ef3445d16cceb201a3e43bb7e5710 Mon Sep 17 00:00:00 2001 From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Date: Wed, 4 Dec 2024 18:47:33 +0100 Subject: [PATCH] fix item meta --- patches/server/General-ItemMeta-fixes.patch | 31 +++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/patches/server/General-ItemMeta-fixes.patch b/patches/server/General-ItemMeta-fixes.patch index 2d713e35ae..6b12704dec 100644 --- a/patches/server/General-ItemMeta-fixes.patch +++ b/patches/server/General-ItemMeta-fixes.patch @@ -2051,6 +2051,37 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end - General ItemMeta Fixes } +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftCustomModelDataComponent.java b/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftCustomModelDataComponent.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftCustomModelDataComponent.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftCustomModelDataComponent.java +@@ -0,0 +0,0 @@ public final class CraftCustomModelDataComponent implements CustomModelDataCompo + + @Override + public void setFlags(List flags) { +- this.handle = new CustomModelData(this.handle.floats(), new ArrayList<>(this.handle.flags()), this.handle.strings(), this.handle.colors()); ++ this.handle = new CustomModelData(this.handle.floats(), List.copyOf(flags), this.handle.strings(), this.handle.colors()); // Paper + } + + @Override +@@ -0,0 +0,0 @@ public final class CraftCustomModelDataComponent implements CustomModelDataCompo + + @Override + public void setStrings(List strings) { +- this.handle = new CustomModelData(this.handle.floats(), this.handle.flags(), new ArrayList<>(this.handle.strings()), this.handle.colors()); ++ this.handle = new CustomModelData(this.handle.floats(), this.handle.flags(), List.copyOf(strings), this.handle.colors()); // Paper + } + + @Override +@@ -0,0 +0,0 @@ public final class CraftCustomModelDataComponent implements CustomModelDataCompo + + @Override + public void setColors(List colors) { +- this.handle = new CustomModelData(this.handle.floats(), this.handle.flags(), this.handle.strings(), new ArrayList<>(this.handle.colors())); ++ this.handle = new CustomModelData(this.handle.floats(), this.handle.flags(), this.handle.strings(), colors.stream().map(Color::asRGB).toList()); // Paper + } + + @Override diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftEquippableComponent.java b/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftEquippableComponent.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftEquippableComponent.java