3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-07-03 22:18:04 +02:00

Remove empty items from various block entities

Dieser Commit ist enthalten in:
Nassim Jahnke 2024-04-19 09:56:24 +02:00
Ursprung 7825a1e460
Commit 3520f99d5a
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F

Datei anzeigen

@ -1343,6 +1343,21 @@ public final class BlockItemPacketRewriter1_20_5 extends ItemRewriter<Clientboun
data.set(StructuredDataKey.BANNER_PATTERNS, layers);
}
}
// Remove air item from brushable blocks, decorated pots, jukeboxes, and lecterns
removeEmptyItem(tag, "item");
removeEmptyItem(tag, "RecordItem");
removeEmptyItem(tag, "Book");
}
private void removeEmptyItem(final CompoundTag tag, final String key) {
final CompoundTag itemTag = tag.getCompoundTag(key);
if (itemTag != null) {
final int id = itemTag.getInt("id");
if (id == 0) {
tag.remove(key);
}
}
}
private void updateSkullOwnerTag(final CompoundTag tag, final CompoundTag skullOwnerTag) {