-
Notifications
You must be signed in to change notification settings - Fork 0
Storage Format
Panayiotis Stylianopoulos edited this page Jul 12, 2026
·
3 revisions
-
CisConstantsdefines format constants. -
CisStorageimplements the storage engine. -
RegionFileimplements region layout and allocation. -
CisMappingpersists mappings. -
ChunkisStoragePathsresolves storage paths.
- Each dimension uses one
chunkis/regions/directory. - Region filenames use the format
r.<regionX>.<regionZ>.cis. -
global_ids.jsonstores the block/state mapping beside the region directory. - Each
RegionFilecontains a fixed 8192-byte header with 1024(offset,length)entries. - Live chunk payload bytes follow the header.
- An optional allocation metadata footer stores reusable holes and reuse counters.
-
CisConstants.MAGICis0x43495334. -
CisConstants.VERSIONis11. - Region compaction is supported and validated before replacement.
- Older files without allocation metadata fall back to header-based reconstruction.
Save paths eventually call CisStorage.prepareSave(...) and writePrepared(...). Load paths decode the bytes back into ChunkDelta objects.
Migration uses the same storage engine instead of a separate file parser.
- Empty deltas delete stored entries instead of writing placeholder payloads.
- Normal load clears corrupt stored entries after decode failure.
- Migration can bypass that clearing path when preserving the source is required.
- Storage format changes must document their migration impact, not only codec changes.
common/src/main/java/io/liparakis/chunkis/core/model/CisConstants.javastorage/src/main/java/io/liparakis/chunkis/storage/io/CisStorage.javastorage/src/main/java/io/liparakis/chunkis/storage/io/region/RegionFile.javastorage/src/main/java/io/liparakis/chunkis/storage/io/region/CisRegionInspector.java