Add entity id to painting items

This commit is contained in:
Nassim Jahnke 2024-05-22 10:40:43 +02:00
parent 9b1c97919c
commit 94e853e5cf
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F

View File

@ -439,9 +439,13 @@ public final class BlockItemPacketRewriter1_20_5 extends ItemRewriter<Clientboun
updateBlockState(data, blockState);
}
final CompoundTag entityTag = tag.getCompoundTag("EntityTag");
CompoundTag entityTag = tag.getCompoundTag("EntityTag");
if (entityTag != null) {
data.set(StructuredDataKey.ENTITY_DATA, entityTag.copy());
entityTag = entityTag.copy();
if (entityTag.contains("variant")) {
entityTag.putString("id", "minecraft:painting");
}
data.set(StructuredDataKey.ENTITY_DATA, entityTag);
}
final CompoundTag blockEntityTag = tag.getCompoundTag("BlockEntityTag");