mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-01-10 01:10:30 +00:00
Don't add lore to item details when empty
This commit is contained in:
parent
cdcd82679c
commit
b89e2615db
@ -50,12 +50,12 @@ public class ItemDetails {
|
|||||||
if (tag != null && tag.contains("display", Tag.TAG_COMPOUND)) {
|
if (tag != null && tag.contains("display", Tag.TAG_COMPOUND)) {
|
||||||
var displayTag = tag.getCompound("display");
|
var displayTag = tag.getCompound("display");
|
||||||
if (displayTag.contains("Lore", Tag.TAG_LIST)) {
|
if (displayTag.contains("Lore", Tag.TAG_LIST)) {
|
||||||
var loreTag = displayTag.getList("Lore", Tag.TAG_STRING);
|
var lore = displayTag.getList("Lore", Tag.TAG_STRING).stream()
|
||||||
data.put("lore", loreTag.stream()
|
|
||||||
.map(ItemDetails::parseTextComponent)
|
.map(ItemDetails::parseTextComponent)
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.map(Component::getString)
|
.map(Component::getString)
|
||||||
.toList());
|
.toList();
|
||||||
|
if (!lore.isEmpty()) data.put("lore", lore);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user