Skip to content

Latest commit

 

History

History
51 lines (39 loc) · 3.4 KB

STORAGE_FORMAT.md

File metadata and controls

51 lines (39 loc) · 3.4 KB

RadServer Storage Format Specification

This document describes the on-disk world storage format used by RadServer (RadVersions/v26_3).

Important: RadServer uses Minecraft Java 26.3 (DataVersion = 4790) Anvil .mca region files, level.dat, and playerdata/<uuid>.dat NBT files. Foreign or corrupt .mca chunk entries are detected on read and protected from being overwritten.

1. World Directory Layout

world/
  level.dat                  # Gzip-compressed vanilla-compatible Level NBT (seed, spawn, time, game_type)
  region/
    r.<rx>.<rz>.mca          # Overworld Anvil regions (chunk sections, heightmaps, block_entities, block_ticks)
  entities/
    r.<rx>.<rz>.mca          # Overworld entity storage (mobs, dropped items)
  DIM-1/                     # Nether region/ & entities/
  DIM1/                      # End region/ & entities/
  playerdata/
    <uuid>.dat               # Per-player gzip-compressed NBT (position, health, food, inventory, dimension, stats)

2. Region Files (region/r.<rx>.<rz>.mca)

  • Header (8192 bytes):
    • Bytes 0..4096: 1024 big-endian 4-byte location entries (offset_sectors_u24, sector_count_u8).
    • Bytes 4096..8192: 1024 timestamp entries (4 bytes each).
  • Chunk Sector Payload:
    • length: u32 (big-endian, includes compression byte)
    • compression: u8 (2 = zlib, 1 = gzip, 3 = uncompressed on read; zlib on write)
    • Bounded decompression (<= 16 MiB uncompressed).
  • Anvil Chunk NBT:
    • Block states (sections[].block_states), biomes (sections[].biomes), heightmaps, block_entities (chests, furnaces, and item component patches), and block_ticks (scheduled redstone/fluid/gravity ticks).
  • Safety Guarantees:
    • Atomic/append-safe writes never overwrite existing valid sector data in place if the new payload grows.
    • Truncated headers or corrupt/foreign chunks are marked protected and refused overwrite on save_all.

3. Vanilla World Round-Trip Coverage

When loading and saving a copy of a vanilla 26.3 world:

  • Preserved / round-tripped: level.dat metadata (seed, spawn, time, world border/game mode), chunk block states, biomes, heightmaps, chest & furnace block_entities (including item components), scheduled block_ticks, entity .mca entries for supported mobs/dropped items, and playerdata/<uuid>.dat.
  • Not yet covered (partial/not modeled): Vanilla chunk generation for ungenerated chunks (uses RadServer's seeded/flat generator), villagers/advancements/scoreboards/raids/custom boss events, and unsupported entity/block-entity types.

4. Player Data (world/playerdata/<uuid>.dat)

Gzip-compressed NBT written atomically via .tmp + sync_all() + rename:

  • Pos, Rotation, Dimension, Health, foodLevel, foodSaturationLevel, playerGameType, SelectedItemSlot, Inventory (46 slots with item IDs and component patches), and radbyte_stats.

5. World Generation & Seed Parity Policy

  • Decision: RadServer (RadVersions/v26_3) does not aim to reproduce vanilla Minecraft 26.3 world generation 1:1 from a numeric seed. Instead, it uses its own deterministic seeded Overworld, Nether, and End generator (WorldgenPalette + generate_seeded_chunk).
  • Exact Vanilla Terrain: Operators who require exact vanilla terrain should pre-generate or import a vanilla 26.3 Anvil world copy; RadServer preserves imported chunks and marks corrupt/foreign entries protected.