aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2024-05-10 12:05:06 -0700
committerJake Potrebic <[email protected]>2024-05-10 12:05:07 -0700
commit39532a1f8cde8f511e8ebd9211b78477d1aaf0e5 (patch)
tree8dd41197275c4019f0fed10754a6e6b479d354aa
parent4fd58a1b8fcb4e044b87a4d4af2f20da53fdb3b3 (diff)
downloadPaper-39532a1f8cde8f511e8ebd9211b78477d1aaf0e5.tar.gz
Paper-39532a1f8cde8f511e8ebd9211b78477d1aaf0e5.zip
Fix stacks losing empty attr modifiers
Fixes #10686
-rw-r--r--patches/server/1044-General-ItemMeta-fixes.patch8
1 files changed, 5 insertions, 3 deletions
diff --git a/patches/server/1044-General-ItemMeta-fixes.patch b/patches/server/1044-General-ItemMeta-fixes.patch
index 7f0b7bc155..fca0b46af1 100644
--- a/patches/server/1044-General-ItemMeta-fixes.patch
+++ b/patches/server/1044-General-ItemMeta-fixes.patch
@@ -260,7 +260,7 @@ index 8e0dd4b7a7a25a8beb27b507047bc48d8227627c..cf5d27ccc2225bac3aa57912f444f95d
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
-index 0bc100430483f88bc7edf17645250b2862ccc1d5..03f9fff7c06bf5f166d6277e3aa6adb5f646042d 100644
+index 0bc100430483f88bc7edf17645250b2862ccc1d5..1f3927ec4a44bc001285869c96a67e687e7438da 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -165,9 +165,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -287,13 +287,15 @@ index 0bc100430483f88bc7edf17645250b2862ccc1d5..03f9fff7c06bf5f166d6277e3aa6adb5
CraftMetaItem.getOrEmpty(tag, CraftMetaItem.NAME).ifPresent((component) -> {
this.displayName = component;
});
-@@ -880,9 +886,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -879,10 +885,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+ }
void applyModifiers(Multimap<Attribute, AttributeModifier> modifiers, CraftMetaItem.Applicator tag) {
- if (modifiers == null || modifiers.isEmpty()) {
+- if (modifiers == null || modifiers.isEmpty()) {
- if (this.hasItemFlag(ItemFlag.HIDE_ATTRIBUTES)) {
- tag.put(CraftMetaItem.ATTRIBUTES, new ItemAttributeModifiers(Collections.emptyList(), false));
- }
++ if (modifiers == null/* || modifiers.isEmpty()*/) { // Paper - empty modifiers has a specific meaning, they should still be saved
+ // Paper - don't save ItemFlag if the underlying data isn't present
return;
}