Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 04:20:04 +01:00
SPIGOT-3699: Fix cloning banner itemstacks
the banner meta would end up with a shared reference to the patterns
Dieser Commit ist enthalten in:
Ursprung
f9c8c9eecf
Commit
b8833f477c
29
Spigot-Server-Patches/0258-Fix-cloning-banner-itemstacks.patch
Normale Datei
29
Spigot-Server-Patches/0258-Fix-cloning-banner-itemstacks.patch
Normale Datei
@ -0,0 +1,29 @@
|
||||
From d8ba17b1464eb0fe35132f092a972c8b97adeeb1 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Fri, 15 Dec 2017 15:52:28 -0500
|
||||
Subject: [PATCH] Fix cloning banner itemstacks
|
||||
|
||||
the banner meta would end up with a shared reference to the patterns
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBanner.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBanner.java
|
||||
index aa1a210a2..3ae4604f0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBanner.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBanner.java
|
||||
@@ -200,4 +200,14 @@ public class CraftMetaBanner extends CraftMetaItem implements BannerMeta {
|
||||
boolean applicableTo(Material type) {
|
||||
return type == Material.BANNER;
|
||||
}
|
||||
+
|
||||
+ // Paper start
|
||||
+ @Override
|
||||
+ public CraftMetaBanner clone() {
|
||||
+ CraftMetaBanner clone = (CraftMetaBanner) super.clone();
|
||||
+ clone.base = this.base;
|
||||
+ clone.patterns = new ArrayList<>(this.patterns);
|
||||
+ return clone;
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
--
|
||||
2.15.1
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren