RegionIO/internal/world
Master290 d1cc29bb60 Chunk persistence to Anvil .mca region files
The world now survives restarts: chunks load from disk (read-through
cache) and player edits persist via async autosave + a final SaveAll on
shutdown. RegionIO finally does region I/O.

- world/regionfile.go: Anvil .mca container — 8192-byte header
  (offset + timestamp tables), 4096-byte sectors, zlib chunk records.
- world/compress.go: zlib deflate/inflate for chunk payloads.
- world/store.go: chunk <-> Level-nested NBT (per-section
  block_states/biomes palettes, WORLD_SURFACE heightmap, DataVersion
  4790, yPos -4) via the existing nbt package; Store opens one
  RegionFile per region with proper floor-division coords.
- world/state_names.go: id->name bridge from the embedded blocks.json
  report so network int-IDs round-trip through the disk named palette.
- world/encode.go: GetBiome read accessor for serialization.
- world/cache.go: read-through (disk then generation), dirty tracking,
  StartAutosave (returns a done channel so the saver exits before
  Close), SaveAll, NewCacheWithStore.
- server.go + main.go: Config.WorldDir (default "world"), -world flag,
  autosave loop every 30s, SaveAll + store Close on signal.
- Tests: region round-trip/absent/overwrite, chunk NBT round-trip,
  end-to-end save-reload, negative chunk coords, autosave persistence.
2026-06-25 00:40:14 +03:00
..
testdata Initial commit: RegionIO Minecraft server core (26.1.2/protocol 775) 2026-06-24 00:32:51 +03:00
bench_test.go Initial commit: RegionIO Minecraft server core (26.1.2/protocol 775) 2026-06-24 00:32:51 +03:00
biome_3d_test.go 3D per-cell biomes (4x4x4) with surface/underground/cave layers 2026-06-24 01:04:01 +03:00
biome_bench_test.go 3D per-cell biomes (4x4x4) with surface/underground/cave layers 2026-06-24 01:04:01 +03:00
biome_lookup.go Biome-aware surface rules from the vanilla rule tree 2026-06-24 19:44:07 +03:00
biome_lookup_test.go 3D per-cell biomes (4x4x4) with surface/underground/cave layers 2026-06-24 01:04:01 +03:00
biome_parameters.json Initial commit: RegionIO Minecraft server core (26.1.2/protocol 775) 2026-06-24 00:32:51 +03:00
blocks.json Chunk persistence to Anvil .mca region files 2026-06-25 00:40:14 +03:00
cache.go Chunk persistence to Anvil .mca region files 2026-06-25 00:40:14 +03:00
chunk.go Initial commit: RegionIO Minecraft server core (26.1.2/protocol 775) 2026-06-24 00:32:51 +03:00
compress.go Chunk persistence to Anvil .mca region files 2026-06-25 00:40:14 +03:00
encode.go Chunk persistence to Anvil .mca region files 2026-06-25 00:40:14 +03:00
encode_test.go Initial commit: RegionIO Minecraft server core (26.1.2/protocol 775) 2026-06-24 00:32:51 +03:00
golden_test.go Initial commit: RegionIO Minecraft server core (26.1.2/protocol 775) 2026-06-24 00:32:51 +03:00
item_blocks.json Initial commit: RegionIO Minecraft server core (26.1.2/protocol 775) 2026-06-24 00:32:51 +03:00
items.go Initial commit: RegionIO Minecraft server core (26.1.2/protocol 775) 2026-06-24 00:32:51 +03:00
light.go Initial commit: RegionIO Minecraft server core (26.1.2/protocol 775) 2026-06-24 00:32:51 +03:00
regionfile.go Chunk persistence to Anvil .mca region files 2026-06-25 00:40:14 +03:00
state_names.go Chunk persistence to Anvil .mca region files 2026-06-25 00:40:14 +03:00
store.go Chunk persistence to Anvil .mca region files 2026-06-25 00:40:14 +03:00
store_test.go Chunk persistence to Anvil .mca region files 2026-06-25 00:40:14 +03:00
surface_verify_test.go Biome-aware surface rules from the vanilla rule tree 2026-06-24 19:44:07 +03:00
terrain.go Initial commit: RegionIO Minecraft server core (26.1.2/protocol 775) 2026-06-24 00:32:51 +03:00
terrain_bench_test.go Initial commit: RegionIO Minecraft server core (26.1.2/protocol 775) 2026-06-24 00:32:51 +03:00
terrain_debug_test.go Initial commit: RegionIO Minecraft server core (26.1.2/protocol 775) 2026-06-24 00:32:51 +03:00
vanilla.go Biome-aware surface rules from the vanilla rule tree 2026-06-24 19:44:07 +03:00
vanilla_bench_test.go Initial commit: RegionIO Minecraft server core (26.1.2/protocol 775) 2026-06-24 00:32:51 +03:00
vanilla_parity_test.go Initial commit: RegionIO Minecraft server core (26.1.2/protocol 775) 2026-06-24 00:32:51 +03:00