Defer BlockEntity attachment syncing to match the usual BE sync timing#2916
Conversation
Last commit published: d8617999c40d2a8cba3171c8f9ce1ccf4c851d12 - version: PR PublishingThe artifacts published by this PR:
Repository DeclarationIn order to use the artifacts published by the PR, add the following repository to your buildscript: repositories {
maven {
name = "Maven for PR #2916" // https://github.com/neoforged/NeoForge/pull/2916
url = uri("https://prmaven.neoforged.net/NeoForge/pr2916")
content {
includeModule("net.neoforged", "neoforge")
includeModule("net.neoforged", "testframework")
}
}
}MDK installationIn order to setup a MDK using the latest PR version, run the following commands in a terminal. mkdir NeoForge-pr2916
cd NeoForge-pr2916
curl -L https://prmaven.neoforged.net/NeoForge/pr2916/net/neoforged/neoforge/26.1.0.0-alpha.26.1-snapshot-4.20260121.224106/mdk-pr2916.zip -o mdk.zip
jar xf mdk.zip
rm mdk.zip || del mdk.zipTo test a production environment, you can download the installer from here. |
| return; | ||
| } | ||
| syncUpdate(blockEntity, type, serverLevel.getChunkSource().chunkMap.getPlayers(ChunkPos.containing(blockEntity.getBlockPos()), false)); | ||
| // For now, we send one packet per attachment type. In the future, consider bundling all the updates in a single packet. |
There was a problem hiding this comment.
They should still be bundled through packet bundling, no?
There was a problem hiding this comment.
No that doesn't happen automatically.
shartte
left a comment
There was a problem hiding this comment.
Game tests are still failing
9480d75 to
d861799
Compare
Instead of eagerly syncing block entity attachments, we store which attachment types need syncing, and we only send the update later, matching the timing of
BlockEntity#getUpdatePacket. This fixes "unknown attachment" errors on the client when an attachment is updated on the server side on a block entity that was already deleted on the client, for example.(I am planning on backporting this to 1.21.11 and 1.21.1 once it receives more testing in 26.1).