aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBjarne Koll <[email protected]>2024-08-16 23:34:45 +0200
committerBjarne Koll <[email protected]>2024-08-16 23:34:53 +0200
commitb96f8011e6105556d85a8105562bfcfe3b97ba66 (patch)
treeafb5a729deeabd90591ca2ed404ffc8d1699f85e
parentc9c50db63c3b0b31ef96ef2b4f09e9dc20ae0c1b (diff)
downloadPaper-b96f8011e6105556d85a8105562bfcfe3b97ba66.tar.gz
Paper-b96f8011e6105556d85a8105562bfcfe3b97ba66.zip
-rw-r--r--patches/server/1047-fixup-fixup-Add-ArmorStand-Item-Meta.patch19
-rw-r--r--patches/server/1048-fixup-Add-ArmorStand-Item-Meta.patch (renamed from patches/server/1046-fixup-Add-ArmorStand-Item-Meta.patch)35
2 files changed, 25 insertions, 29 deletions
diff --git a/patches/server/1047-fixup-fixup-Add-ArmorStand-Item-Meta.patch b/patches/server/1047-fixup-fixup-Add-ArmorStand-Item-Meta.patch
deleted file mode 100644
index b45600d2b7..0000000000
--- a/patches/server/1047-fixup-fixup-Add-ArmorStand-Item-Meta.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Shane Freeder <[email protected]>
-Date: Thu, 15 Aug 2024 22:36:26 +0100
-Subject: [PATCH] fixup! fixup! Add ArmorStand Item Meta
-
-
-diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java
-index 65175910d99999fc42247aab33396b3078851fe4..dcdf45cce137233cde8134a1db50a76bec864151 100644
---- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java
-+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java
-@@ -214,7 +214,7 @@ public class CraftMetaArmorStand extends CraftMetaItem implements com.destroysto
- private void populateTagIfNull() {
- if (this.entityTag == null) {
- this.entityTag = new CompoundTag();
-- this.entityTag.putString(ENTITY_ID.NBT, "minecraft:armorstand");
-+ this.entityTag.putString(ENTITY_ID.NBT, "minecraft:armor_stand");
- }
- }
-
diff --git a/patches/server/1046-fixup-Add-ArmorStand-Item-Meta.patch b/patches/server/1048-fixup-Add-ArmorStand-Item-Meta.patch
index f2e09da071..6104bc7b7c 100644
--- a/patches/server/1046-fixup-Add-ArmorStand-Item-Meta.patch
+++ b/patches/server/1048-fixup-Add-ArmorStand-Item-Meta.patch
@@ -1,11 +1,11 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <[email protected]>
-Date: Thu, 18 Jul 2024 15:41:18 +0100
+Date: Thu, 15 Aug 2024 22:36:26 +0100
Subject: [PATCH] fixup! Add ArmorStand Item Meta
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java
-index 53df7e876c9f3e67aa2326fa1a5ce5e90ab7efd6..65175910d99999fc42247aab33396b3078851fe4 100644
+index 53df7e876c9f3e67aa2326fa1a5ce5e90ab7efd6..b9ab022c622da38e550ca7c2df8bd2d067fd803b 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java
@@ -15,17 +15,12 @@ public class CraftMetaArmorStand extends CraftMetaItem implements com.destroysto
@@ -85,7 +85,7 @@ index 53df7e876c9f3e67aa2326fa1a5ce5e90ab7efd6..65175910d99999fc42247aab33396b30
+ } catch (java.io.IOException ex) {
+ java.util.logging.Logger.getLogger(CraftMetaItem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ }
-+ return;
++ // Fallthrough here to prioritize legacy fields in the map. Should generally be none.
+ }
+ SerializableMeta.getObjectOptionally(Boolean.class, map, INVISIBLE.BUKKIT, true).ifPresent((value) -> {
+ populateTagIfNull();
@@ -114,7 +114,22 @@ index 53df7e876c9f3e67aa2326fa1a5ce5e90ab7efd6..65175910d99999fc42247aab33396b30
// Paper end
}
-@@ -107,31 +103,6 @@ public class CraftMetaArmorStand extends CraftMetaItem implements com.destroysto
+@@ -93,12 +89,13 @@ public class CraftMetaArmorStand extends CraftMetaItem implements com.destroysto
+
+ if (tag.contains(CraftMetaArmorStand.ENTITY_TAG.NBT)) {
+ this.entityTag = tag.getCompound(CraftMetaArmorStand.ENTITY_TAG.NBT);
++ if (!this.entityTag.contains(ENTITY_ID.NBT)) entityTag.putString(ENTITY_ID.NBT, "minecraft:armor_stand"); // Paper - fixup legacy armorstand metas that did not include this.
+ }
+ }
+
+ @Override
+ void serializeInternal(Map<String, Tag> internalTags) {
+- if (this.entityTag != null && !this.entityTag.isEmpty()) {
++ if (this.entityTag != null && !this.entityTag.isEmpty() && false) { // Paper - now correctly serialised as entity tag
+ internalTags.put(CraftMetaArmorStand.ENTITY_TAG.NBT, this.entityTag);
+ }
+ }
+@@ -107,31 +104,6 @@ public class CraftMetaArmorStand extends CraftMetaItem implements com.destroysto
void applyToItem(CraftMetaItem.Applicator tag) {
super.applyToItem(tag);
@@ -146,7 +161,7 @@ index 53df7e876c9f3e67aa2326fa1a5ce5e90ab7efd6..65175910d99999fc42247aab33396b30
if (this.entityTag != null) {
tag.put(CraftMetaArmorStand.ENTITY_TAG, CustomData.of(this.entityTag));
}
-@@ -148,7 +119,7 @@ public class CraftMetaArmorStand extends CraftMetaItem implements com.destroysto
+@@ -148,7 +120,7 @@ public class CraftMetaArmorStand extends CraftMetaItem implements com.destroysto
}
boolean isArmorStandEmpty() {
@@ -155,7 +170,7 @@ index 53df7e876c9f3e67aa2326fa1a5ce5e90ab7efd6..65175910d99999fc42247aab33396b30
}
@Override
-@@ -160,12 +131,7 @@ public class CraftMetaArmorStand extends CraftMetaItem implements com.destroysto
+@@ -160,12 +132,7 @@ public class CraftMetaArmorStand extends CraftMetaItem implements com.destroysto
CraftMetaArmorStand that = (CraftMetaArmorStand) meta;
// Paper start
@@ -169,7 +184,7 @@ index 53df7e876c9f3e67aa2326fa1a5ce5e90ab7efd6..65175910d99999fc42247aab33396b30
// Paper end
}
return true;
-@@ -184,13 +150,6 @@ public class CraftMetaArmorStand extends CraftMetaItem implements com.destroysto
+@@ -184,13 +151,6 @@ public class CraftMetaArmorStand extends CraftMetaItem implements com.destroysto
if (this.entityTag != null) {
hash = 73 * hash + this.entityTag.hashCode();
}
@@ -183,7 +198,7 @@ index 53df7e876c9f3e67aa2326fa1a5ce5e90ab7efd6..65175910d99999fc42247aab33396b30
return original != hash ? CraftMetaArmorStand.class.hashCode() ^ hash : hash;
}
-@@ -200,24 +159,40 @@ public class CraftMetaArmorStand extends CraftMetaItem implements com.destroysto
+@@ -200,24 +160,40 @@ public class CraftMetaArmorStand extends CraftMetaItem implements com.destroysto
super.serialize(builder);
// Paper start
@@ -234,14 +249,14 @@ index 53df7e876c9f3e67aa2326fa1a5ce5e90ab7efd6..65175910d99999fc42247aab33396b30
}
// Paper end
-@@ -236,54 +211,66 @@ public class CraftMetaArmorStand extends CraftMetaItem implements com.destroysto
+@@ -236,54 +212,66 @@ public class CraftMetaArmorStand extends CraftMetaItem implements com.destroysto
}
// Paper start
+ private void populateTagIfNull() {
+ if (this.entityTag == null) {
+ this.entityTag = new CompoundTag();
-+ this.entityTag.putString(ENTITY_ID.NBT, "minecraft:armorstand");
++ this.entityTag.putString(ENTITY_ID.NBT, "minecraft:armor_stand");
+ }
+ }
+