From b89e2615db63778d971d39a119eea96c054370f0 Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Sun, 18 Aug 2024 10:28:16 +0100 Subject: [PATCH] Don't add lore to item details when empty --- .../dan200/computercraft/shared/details/ItemDetails.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/common/src/main/java/dan200/computercraft/shared/details/ItemDetails.java b/projects/common/src/main/java/dan200/computercraft/shared/details/ItemDetails.java index 650ad3bb9..d29249773 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/details/ItemDetails.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/details/ItemDetails.java @@ -50,12 +50,12 @@ public class ItemDetails { if (tag != null && tag.contains("display", Tag.TAG_COMPOUND)) { var displayTag = tag.getCompound("display"); if (displayTag.contains("Lore", Tag.TAG_LIST)) { - var loreTag = displayTag.getList("Lore", Tag.TAG_STRING); - data.put("lore", loreTag.stream() + var lore = displayTag.getList("Lore", Tag.TAG_STRING).stream() .map(ItemDetails::parseTextComponent) .filter(Objects::nonNull) .map(Component::getString) - .toList()); + .toList(); + if (!lore.isEmpty()) data.put("lore", lore); } }