Skip to content

Conversation

@MSKatKing
Copy link
Contributor

@MSKatKing MSKatKing commented Dec 30, 2025

This PR rewrites the chunk data structure to be more efficient both memory-wise and time-wise. It also sticks somewhat close to Mojang's implementation so that data can be prevented from being cloned more than once when being sent to the client.

The chunk data structure itself is mostly implemented, some things still need to be tweaked however.

This PR is still a draft because these things still need to be implemented:

  • Remove old chunk implementation and patch in new one throughout codebase
  • Use existing BlockStateId struct instead of type rename
  • More thoroughly test
  • Try out different optimizations and see how they work
  • Ensure vanilla importing still works
  • Optimize chunk sections before saving to disk This should be a separate PR because it requires a partial rewrite of the disk system which isn't in the scope of this PR. I'd like a separate disk format for chunks to ensure version compatibility.

Copy link
Collaborator

@ReCore-sys ReCore-sys left a comment

Choose a reason for hiding this comment

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

Solid work, just a few (mostly performance) changes needed

@MSKatKing MSKatKing marked this pull request as ready for review January 9, 2026 04:28
@ReCore-sys ReCore-sys merged commit 201c245 into ferrumc-rs:master Jan 10, 2026
6 checks passed
@MSKatKing MSKatKing deleted the feature/chunk-rewrite branch January 10, 2026 04:30
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.

2 participants