Don't add block entity tag if the id is missing

This commit is contained in:
Nassim Jahnke 2024-09-26 12:16:06 +02:00
parent 6bae039d52
commit 619eecacf8
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F

View File

@ -488,7 +488,11 @@ public final class BlockItemPacketRewriter1_20_5 extends ItemRewriter<Clientboun
if (blockEntityTag != null) {
final CompoundTag clonedTag = blockEntityTag.copy();
updateBlockEntityTag(connection, data, clonedTag);
item.dataContainer().set(StructuredDataKey.BLOCK_ENTITY_DATA, clonedTag);
// Not always needed, e.g. shields that had the base color in a block entity tag before
if (blockEntityTag.contains("id")) {
item.dataContainer().set(StructuredDataKey.BLOCK_ENTITY_DATA, clonedTag);
}
}
final CompoundTag debugProperty = tag.getCompoundTag("DebugProperty");