fix item meta

This commit is contained in:
Lulu13022002 2024-12-04 18:47:33 +01:00
parent 1cc86be2b8
commit b0d7153f50
No known key found for this signature in database
GPG Key ID: 491C8F0B8ACDEB01

View File

@ -2051,6 +2051,37 @@ index 7c07ce8af54c367f7ba1b20a06d0879df6c46d54..1fc7af0f8e32bc7c07e187241d78220e
+ }
+ // 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 53de6a9b0e72b8bd519949d2b76efe9c558305c5..09c6d22f83895b734a39732b1ba99acc35b27881 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftCustomModelDataComponent.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftCustomModelDataComponent.java
@@ -67,7 +67,7 @@ public final class CraftCustomModelDataComponent implements CustomModelDataCompo
@Override
public void setFlags(List<Boolean> 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
@@ -77,7 +77,7 @@ public final class CraftCustomModelDataComponent implements CustomModelDataCompo
@Override
public void setStrings(List<String> 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
@@ -87,7 +87,7 @@ public final class CraftCustomModelDataComponent implements CustomModelDataCompo
@Override
public void setColors(List<Color> 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 eaa7c3b4988bd2b2c76dc32b44a087d88089074b..c3bfd621fdf00d400c1600a294262df60b0cd6a5 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftEquippableComponent.java