3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-09-07 13:22:54 +02:00

Fix empty json in 1.14->1.13 items

Dieser Commit ist enthalten in:
KennyTV 2020-07-06 15:06:01 +02:00
Ursprung 6b96e1a8e2
Commit 59cb67da6e
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B

Datei anzeigen

@ -538,21 +538,19 @@ public class BlockItemPackets1_14 extends nl.matsv.viabackwards.api.rewriters.It
CompoundTag display = tag.get("display");
if (((CompoundTag) tag.get("display")).get("Lore") instanceof ListTag) {
ListTag lore = display.get("Lore");
ListTag via = display.get(nbtTagName + "|Lore");
ListTag via = display.remove(nbtTagName + "|Lore");
if (via != null) {
display.put(ConverterRegistry.convertToTag("Lore", ConverterRegistry.convertToValue(via)));
} else {
for (Tag loreEntry : lore) {
if (loreEntry instanceof StringTag) {
((StringTag) loreEntry).setValue(
ChatRewriter.jsonTextToLegacy(
((StringTag) loreEntry).getValue()
)
);
if (!(loreEntry instanceof StringTag)) continue;
String value = ((StringTag) loreEntry).getValue();
if (value != null && !value.isEmpty()) {
((StringTag) loreEntry).setValue(ChatRewriter.jsonTextToLegacy(value));
}
}
}
display.remove(nbtTagName + "|Lore");
}
}