1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-01-09 08:50:29 +00:00

Don't add lore to item details when empty

This commit is contained in:
Jonathan Coates 2024-08-18 10:28:16 +01:00
parent cdcd82679c
commit b89e2615db
No known key found for this signature in database
GPG Key ID: B9E431FF07C98D06

View File

@ -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);
}
}