SPIGOT-7621: Fix empty strings in item lore

This commit is contained in:
md_5 2024-04-24 08:12:08 +10:00
parent 3b72391602
commit 062d2bb13b
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -1643,11 +1643,12 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
addTo.add(IChatBaseComponent.empty());
} else {
String entry = object.toString();
IChatBaseComponent component = (possiblyJsonInput) ? CraftChatMessage.fromJSONOrString(entry) : CraftChatMessage.fromStringOrNull(entry);
if (possiblyJsonInput) {
addTo.add(CraftChatMessage.fromJSONOrString(entry));
if (component != null) {
addTo.add(component);
} else {
addTo.add(CraftChatMessage.fromStringOrNull(entry));
addTo.add(IChatBaseComponent.empty());
}
}
}