From eae7eb06dfdf6fb33ee0ba8f40379401a9fc9b7e Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sun, 6 Oct 2019 18:34:51 +1100 Subject: [PATCH] SPIGOT-5342: Lore lost when deserializing items with no version stored By: md_5 --- .../java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java index 4e838f853b..b2bf896ad1 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -674,7 +674,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { NBTTagList tagList = new NBTTagList(); for (IChatBaseComponent value : list) { - tagList.add(new NBTTagString(version >= 1803 ? CraftChatMessage.toJSON(value) : CraftChatMessage.fromComponent(value, EnumChatFormat.DARK_PURPLE))); // SPIGOT-4935 + // SPIGOT-5342 - horrible hack as 0 version does not go through the Mojang updater + tagList.add(new NBTTagString(0 <= version || version >= 1803 ? CraftChatMessage.toJSON(value) : CraftChatMessage.fromComponent(value, EnumChatFormat.DARK_PURPLE))); // SPIGOT-4935 } return tagList;