diff options
Diffstat (limited to 'patches/server/1044-General-ItemMeta-fixes.patch')
-rw-r--r-- | patches/server/1044-General-ItemMeta-fixes.patch | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/patches/server/1044-General-ItemMeta-fixes.patch b/patches/server/1044-General-ItemMeta-fixes.patch index 11d78582bd..ddeca70bac 100644 --- a/patches/server/1044-General-ItemMeta-fixes.patch +++ b/patches/server/1044-General-ItemMeta-fixes.patch @@ -32,7 +32,7 @@ index 8e2b3dd109dca3089cbce82cd3788874613a3230..893efb2c4a07c33d41e934279dd914a9 // CraftBukkit end diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java -index f37858eb18defbf11b2f4fe825ab9416ebbc7210..7963afff4b32a0e46be9bdeb413657718cfc14f5 100644 +index 65170cbb50d8d5030fc5e33b6389c554aec6ae31..6349f2e0a5ba30d250f5ffe43771f325c0999a76 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java @@ -140,6 +140,11 @@ public abstract class BlockEntity { @@ -48,10 +48,10 @@ index f37858eb18defbf11b2f4fe825ab9416ebbc7210..7963afff4b32a0e46be9bdeb41365771 } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java -index f97d47677e13441c0b39eb8d18ebee428ea53ca4..a0b7ec67755c5090f24bf9ec81f110c68cd064ca 100644 +index 397eb1a101bd60f49dbb2fa8eddf28f6f233167f..ce10aa64576716f530e69d2281c090cfdba5e18f 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java -@@ -132,6 +132,15 @@ public abstract class CraftBlockEntityState<T extends BlockEntity> extends Craft +@@ -135,6 +135,15 @@ public abstract class CraftBlockEntityState<T extends BlockEntity> extends Craft return nbt; } @@ -116,10 +116,10 @@ index 2d6abecc94683f92da6be26b72ea829663b16d76..6a3b0c7f0cc3ffb17a231383ad103fa7 for (Pattern p : this.patterns) { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java -index 3b647cb57918ed9d4b54dca718af80d20730c42e..aee276c844b9efc3c16b3f728ef237707011958d 100644 +index a1e10c14375b81f97e37105df43ab8f13461474c..88a48b7bd1ae7381ddd63052b02f03dcc6671411 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java -@@ -234,7 +234,15 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta +@@ -209,7 +209,15 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta super.applyToItem(tag); if (this.blockEntityTag != null) { @@ -243,7 +243,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 b351ee556b732e7081a7a6157460ade219829f17..38454fdc978a24a35e685e65e9b41323781c3ead 100644 +index 0bc100430483f88bc7edf17645250b2862ccc1d5..ab23597a099a2785c803e08c93ff9f046a4af677 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 { @@ -258,7 +258,18 @@ index b351ee556b732e7081a7a6157460ade219829f17..38454fdc978a24a35e685e65e9b41323 <T> Applicator put(ItemMetaKeyType<T> key, T value) { this.builder.set(key.TYPE, value); -@@ -1004,6 +1005,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -880,9 +881,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { + + void applyModifiers(Multimap<Attribute, AttributeModifier> modifiers, CraftMetaItem.Applicator tag) { + if (modifiers == null || modifiers.isEmpty()) { +- if (this.hasItemFlag(ItemFlag.HIDE_ATTRIBUTES)) { +- tag.put(CraftMetaItem.ATTRIBUTES, new ItemAttributeModifiers(Collections.emptyList(), false)); +- } ++ // Paper - don't save ItemFlag if the underlying data isn't present + return; + } + +@@ -1007,6 +1006,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @Override public void lore(final List<? extends net.kyori.adventure.text.Component> lore) { @@ -266,7 +277,7 @@ index b351ee556b732e7081a7a6157460ade219829f17..38454fdc978a24a35e685e65e9b41323 this.lore = lore != null ? io.papermc.paper.adventure.PaperAdventure.asVanilla(lore) : null; } // Paper end -@@ -1128,6 +1130,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1131,6 +1131,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { // Paper end @Override public void setLore(List<String> lore) { @@ -274,7 +285,7 @@ index b351ee556b732e7081a7a6157460ade219829f17..38454fdc978a24a35e685e65e9b41323 if (lore == null || lore.isEmpty()) { this.lore = null; } else { -@@ -1143,6 +1146,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1146,6 +1147,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { // Paper start @Override public void setLoreComponents(List<net.md_5.bungee.api.chat.BaseComponent[]> lore) { @@ -282,7 +293,7 @@ index b351ee556b732e7081a7a6157460ade219829f17..38454fdc978a24a35e685e65e9b41323 if (lore == null) { this.lore = null; } else { -@@ -1410,7 +1414,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1413,7 +1415,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @Override public String getAsString() { |