mirror of
https://github.com/ViaVersion/ViaBackwards.git
synced 2024-11-02 09:09:55 +01:00
Fix empty json in 1.14->1.13 items
This commit is contained in:
parent
6b96e1a8e2
commit
59cb67da6e
@ -538,21 +538,19 @@ public class BlockItemPackets1_14 extends nl.matsv.viabackwards.api.rewriters.It
|
|||||||
CompoundTag display = tag.get("display");
|
CompoundTag display = tag.get("display");
|
||||||
if (((CompoundTag) tag.get("display")).get("Lore") instanceof ListTag) {
|
if (((CompoundTag) tag.get("display")).get("Lore") instanceof ListTag) {
|
||||||
ListTag lore = display.get("Lore");
|
ListTag lore = display.get("Lore");
|
||||||
ListTag via = display.get(nbtTagName + "|Lore");
|
ListTag via = display.remove(nbtTagName + "|Lore");
|
||||||
if (via != null) {
|
if (via != null) {
|
||||||
display.put(ConverterRegistry.convertToTag("Lore", ConverterRegistry.convertToValue(via)));
|
display.put(ConverterRegistry.convertToTag("Lore", ConverterRegistry.convertToValue(via)));
|
||||||
} else {
|
} else {
|
||||||
for (Tag loreEntry : lore) {
|
for (Tag loreEntry : lore) {
|
||||||
if (loreEntry instanceof StringTag) {
|
if (!(loreEntry instanceof StringTag)) continue;
|
||||||
((StringTag) loreEntry).setValue(
|
|
||||||
ChatRewriter.jsonTextToLegacy(
|
String value = ((StringTag) loreEntry).getValue();
|
||||||
((StringTag) loreEntry).getValue()
|
if (value != null && !value.isEmpty()) {
|
||||||
)
|
((StringTag) loreEntry).setValue(ChatRewriter.jsonTextToLegacy(value));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
display.remove(nbtTagName + "|Lore");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user