Skip to content

Defer block entity attachment syncing to match vanilla's sync timing#5178

Merged
modmuss50 merged 12 commits intoFabricMC:26.1from
DennisOchulor:defer-att-sync
Feb 3, 2026
Merged

Defer block entity attachment syncing to match vanilla's sync timing#5178
modmuss50 merged 12 commits intoFabricMC:26.1from
DennisOchulor:defer-att-sync

Conversation

@DennisOchulor
Copy link
Contributor

Currently block entity attachments are synced immediately on set, which is fine in most cases but causes problems in some edge cases:

  1. Placing a BE in an already loaded chunk can sync too early if attachment is set before vanilla syncs the BE data
  2. Breaking a BE can cause the client to receive unknown target syncs if attachment is set before the server registers the BE being broken

Deferring the sync to match when vanilla syncs solves both of these issues. Current implementation probably needs a bit more testing.

Linked to #5107 and also inspired by Neo's PR for the same issue.

# Conflicts:
#	fabric-data-attachment-api-v1/src/main/java/net/fabricmc/fabric/mixin/attachment/BlockEntityMixin.java
#	fabric-data-attachment-api-v1/src/main/resources/fabric-data-attachment-api-v1.mixins.json
# Conflicts:
#	fabric-data-attachment-api-v1/src/main/java/net/fabricmc/fabric/mixin/attachment/AttachmentTargetsMixin.java
@modmuss50 modmuss50 added the status: merge me please Pull requests that are ready to merge label Feb 3, 2026
@modmuss50 modmuss50 merged commit d1729c4 into FabricMC:26.1 Feb 3, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: merge me please Pull requests that are ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants