Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-28 17:10:13 +01:00
Handle empty items in item lists
Dieser Commit ist enthalten in:
Ursprung
5f90bcbbaf
Commit
8aa6769193
@ -755,6 +755,7 @@ public final class StructuredDataConverter {
|
|||||||
final ListTag<CompoundTag> itemsTag = new ListTag<>(CompoundTag.class);
|
final ListTag<CompoundTag> itemsTag = new ListTag<>(CompoundTag.class);
|
||||||
for (final Item item : items) {
|
for (final Item item : items) {
|
||||||
final CompoundTag savedItem = new CompoundTag();
|
final CompoundTag savedItem = new CompoundTag();
|
||||||
|
if (item != null) {
|
||||||
final String name = toMappedItemName(item.identifier());
|
final String name = toMappedItemName(item.identifier());
|
||||||
savedItem.putString("id", name);
|
savedItem.putString("id", name);
|
||||||
if (backupInconvertibleData && name.isEmpty()) {
|
if (backupInconvertibleData && name.isEmpty()) {
|
||||||
@ -767,6 +768,10 @@ public final class StructuredDataConverter {
|
|||||||
writeToTag(data, itemTag);
|
writeToTag(data, itemTag);
|
||||||
}
|
}
|
||||||
savedItem.put("tag", itemTag);
|
savedItem.put("tag", itemTag);
|
||||||
|
} else {
|
||||||
|
savedItem.putString("id", "air");
|
||||||
|
}
|
||||||
|
|
||||||
itemsTag.add(savedItem);
|
itemsTag.add(savedItem);
|
||||||
}
|
}
|
||||||
tag.put(key, itemsTag);
|
tag.put(key, itemsTag);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren