Skip to content

Commit

Permalink
Don't add lore to item details when empty
Browse files Browse the repository at this point in the history
  • Loading branch information
SquidDev committed Aug 18, 2024
1 parent cdcd826 commit b89e261
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ public static void fill(Map<? super String, Object> data, ItemStack stack) {
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);
}
}

Expand Down

0 comments on commit b89e261

Please sign in to comment.