Skip to content

Switch client sync to use buffers instead of tags for data - #5336

Open
gustovafing wants to merge 31 commits into
1.20.1from
gus/update-sync
Open

Switch client sync to use buffers instead of tags for data#5336
gustovafing wants to merge 31 commits into
1.20.1from
gus/update-sync

Conversation

@gustovafing

Copy link
Copy Markdown
Member

What

Switches client sync data to be written into buffers instead of as tags, since NBT has a much higher packet size than buffers causing network issues.

AI Used: Jurre helping to debug an issue with Claude.

How Was This Tested

Tested a variety of BEs with client sync data in game, no issues

@gustovafing
gustovafing requested a review from a team as a code owner August 23, 2026 08:10
@gustovafing gustovafing added type: bugfix General bug fixes 1.20.1 Release: Patch - 0.0.X Smaller changes that either are bug fixes or very minor tweaks. ignore changelog PR should not be added to the changelog. Ignore Version Sync Do not append this issue to the version sync issue tracker. labels Aug 23, 2026
@github-actions github-actions Bot added the Tests: Failed Game Tests have failed on this PR label Aug 23, 2026

@screret screret left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The classes in the com.gregtechceu.gtceu.api.sync.transformers.gtceu package should be in com.gregtechceu.gtceu.common.sync.transformers, no?

@screret

screret commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

From the (failed) tests' logs:

[08:15:07] [Server thread/ERROR] [GregTechCEu/]: Sync: Failed to deserialize field rotorMaterial
java.lang.ClassCastException: class net.minecraft.nbt.CompoundTag cannot be cast to class net.minecraft.nbt.StringTag
	at com.gregtechceu.gtceu.api.sync_system.data_transformers.ResourceLocationReferenceTransformer.deserializeNBT(ResourceLocationReferenceTransformer.java:31)
	at com.gregtechceu.gtceu.api.sync_system.SyncDataHolder.deserializeNBT(SyncDataHolder.java:95)
	at com.gregtechceu.gtceu.api.sync_system.managed.ManagedSyncBlockEntity.load(ManagedSyncBlockEntity.java:71)
	at com.gregtechceu.gtceu.api.machine.MetaMachine.load(MetaMachine.java:166)
...

Comment thread src/main/java/com/gregtechceu/gtceu/api/machine/trait/MachineTraitHolder.java Outdated
Comment thread src/main/java/com/gregtechceu/gtceu/api/machine/trait/MachineTraitHolder.java Outdated
Comment thread src/main/java/com/gregtechceu/gtceu/api/sync_system/SyncDataHolder.java Outdated
Comment thread src/main/java/com/gregtechceu/gtceu/api/sync_system/SyncDataHolder.java Outdated
Comment thread src/main/java/com/gregtechceu/gtceu/api/sync_system/SyncDataHolder.java Outdated
gustovafing and others added 19 commits August 24, 2026 10:44
Co-authored-by: screret <68943070+screret@users.noreply.github.com>
Co-authored-by: screret <68943070+screret@users.noreply.github.com>
Co-authored-by: screret <68943070+screret@users.noreply.github.com>
Co-authored-by: screret <68943070+screret@users.noreply.github.com>
Co-authored-by: screret <68943070+screret@users.noreply.github.com>
Co-authored-by: screret <68943070+screret@users.noreply.github.com>
Co-authored-by: screret <68943070+screret@users.noreply.github.com>
Co-authored-by: screret <68943070+screret@users.noreply.github.com>
Co-authored-by: screret <68943070+screret@users.noreply.github.com>
Co-authored-by: screret <68943070+screret@users.noreply.github.com>
Co-authored-by: screret <68943070+screret@users.noreply.github.com>
Co-authored-by: screret <68943070+screret@users.noreply.github.com>
Co-authored-by: screret <68943070+screret@users.noreply.github.com>
Co-authored-by: screret <68943070+screret@users.noreply.github.com>
@github-actions github-actions Bot added Tests: Passed Game Tests have passed on this PR and removed Tests: Failed Game Tests have failed on this PR labels Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.20.1 ignore changelog PR should not be added to the changelog. Ignore Version Sync Do not append this issue to the version sync issue tracker. Release: Patch - 0.0.X Smaller changes that either are bug fixes or very minor tweaks. Tests: Passed Game Tests have passed on this PR type: bugfix General bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants