Skip to content

Fix erosion sync flooding on player login - #64

Open
kaiserproger wants to merge 1 commit into
milkucha:1.20.1-forgefrom
kaiserproger:fix/forge-chunk-scoped-erosion-sync
Open

kaiserproger wants to merge 1 commit into
milkucha:1.20.1-forgefrom
kaiserproger:fix/forge-chunk-scoped-erosion-sync

Conversation

@kaiserproger

@kaiserproger kaiserproger commented Aug 9, 2026 •

Copy link
Copy Markdown

What this fixes

Closes issue #63.

On large worlds, sendFullSyncToPlayer() sends every persisted erosion chunk to a player during login. In our production world this produced 100k+ trmt:main packets immediately after joining, delaying vanilla chunk data and keepalives enough to cause empty-world/void symptoms and Timed out disconnects.

A packet trace from the failing case showed ~102k TRMT payloads and ~132 MB received while zero ClientboundLevelChunkWithLightPacket and zero ClientboundKeepAlivePacket reached the client.

Change

  • Stop sending the world-wide erosion sync from PlayerLoggedInEvent.
  • Sync erosion data when Forge fires ChunkWatchEvent.Watch, so the client only receives data for chunks it actually tracks.
  • Send an empty chunk sync when there is no erosion data so stale client cache entries are cleared on re-watch.

We tested the same approach on the affected server and the player could join normally afterward.

I have read the Contributor License Agreement in CLA.md and I agree to its terms.

Verification

gradle build passes on the 1.20.1-forge branch with Forge 47.4.10 / Java 17.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant