-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
Chunkis is organized as a layered persistence system. Minecraft integration lives in the fabric module, while storage and migration logic remain independent from Fabric wherever possible.
| Module | Responsibility |
|---|---|
common |
Shared data models, codecs, compression, constants, and debug structures |
storage |
CIS storage engine, region files, mappings, allocation metadata, and inspection |
migration |
CIS version upgrades and storage-backed migrations |
fabric |
Minecraft entrypoints, mixins, tracking, restoration, networking, and MCA migration |
flowchart TD
Minecraft["Minecraft runtime"] --> Fabric["fabric module"]
Fabric --> Tracking["Mutation tracking"]
Fabric --> Save["Save pipeline"]
Fabric --> Load["Load and restore pipeline"]
Fabric --> Sync["Client synchronization"]
Save --> Storage["storage module"]
Load --> Storage
Storage --> Common["common module"]
Migration["migration module"] --> Storage
- Minecraft mutates a loaded chunk.
- Chunkis tracking records relevant changes in a
ChunkDelta. - The save pipeline determines whether the delta is Chunkis-owned.
- The delta is encoded and written to CIS region storage.
- During loading, Chunkis resolves the appropriate delta from memory, cache, prefetch, or disk.
- Vanilla deserialization creates the initial chunk structure.
- Chunkis restores blocks, block entities, entities, and metadata into the live chunk.
- Derived Minecraft state is refreshed after restoration.
Not every ChunkDelta attached to a chunk is automatically authoritative. Chunkis distinguishes between attached state, Chunkis-owned state, restorable state, dirty state, and persisted-base state.
This prevents weaker or stale data from overwriting authoritative data and allows vanilla reads to remain available while selectively suppressing vanilla writes.
See Delta and Ownership Model.
CIS storage uses dimension-specific region directories and provides region file management, chunk payload allocation, compression, mappings, allocation metadata, region inspection, corruption handling, and storage format versioning.
See Storage Format.
The save path captures authoritative chunk state and writes it through CisStorage.
The load path resolves the best available Chunkis state, builds the NBT required by vanilla deserialization, attaches the decoded ChunkDelta, restores Chunkis-owned data, suppresses mutation tracking during replay, and refreshes derived chunk state.
See Load and Restore Pipeline.
Chunkis supports CIS-to-CIS version upgrades and vanilla MCA-to-CIS migration. MCA migration produces authoritative CIS snapshots before normal world runtime begins.
- CIS is authoritative only when ownership has been explicitly established.
- Storage mechanics should remain independent from Minecraft integration.
- Vanilla serialization is reused where practical.
- Restore replay must not be mistaken for fresh gameplay mutation.
- Format changes require migration support and documentation.
- Persistence behavior must be validated with unit tests and game tests.