From 602a6e2bee7fdf519791a102b608987b04d4ade2 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 15 Dec 2017 15:57:15 -0500 Subject: [PATCH] SPIGOT-3699: Fix cloning banner itemstacks the banner meta would end up with a shared reference to the patterns --- .../Fix-cloning-banner-itemstacks.patch | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Spigot-Server-Patches/Fix-cloning-banner-itemstacks.patch diff --git a/Spigot-Server-Patches/Fix-cloning-banner-itemstacks.patch b/Spigot-Server-Patches/Fix-cloning-banner-itemstacks.patch new file mode 100644 index 0000000000..48ee8252e7 --- /dev/null +++ b/Spigot-Server-Patches/Fix-cloning-banner-itemstacks.patch @@ -0,0 +1,27 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +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 +@@ -0,0 +0,0 @@ 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 + } +-- \ No newline at end of file