#!/usr/bin/env python3 """Build owner-like FloatingIslands -> SurfaceWorld -> TunnelNetwork fixtures.""" import copy import json from pathlib import Path ROOT = Path(__file__).resolve().parents[4] SOURCE = ROOT / "Standalone/data/owner_world.json" OUT = ROOT / "Saved/Linux/l33/fixtures" def make_fixture(style: int) -> Path: world = json.loads(SOURCE.read_text(encoding="utf-8")) source_tunnel, source_surface = world["strates"] floating = copy.deepcopy(source_tunnel) floating.update(index=0, top_chunk_z=0, bottom_chunk_z=-15, height_chunks=16) floating["asset"]["StrateName"] = "Linux33 Upper FloatingIslands" floating["asset"]["StrateHeightInChunks"] = 16 floating["asset"]["GeneratorType"] = 6 surface = copy.deepcopy(source_surface) surface.update(index=1, top_chunk_z=-16, bottom_chunk_z=-79, height_chunks=64) surface["asset"]["StrateName"] = "Linux33 Middle SurfaceWorld" surface["asset"]["StrateHeightInChunks"] = 64 surface["asset"]["PassageConfig"]["Style"] = style surface["passage_config"]["Style"] = style tunnel = copy.deepcopy(source_tunnel) tunnel.update(index=2, top_chunk_z=-80, bottom_chunk_z=-143, height_chunks=64) tunnel["asset"]["StrateName"] = "Linux33 Lower TunnelNetwork" tunnel["asset"]["StrateHeightInChunks"] = 64 world["strates"] = [floating, surface, tunnel] world["total_strates"] = 3 world["settings_asset"]["TotalStrates"] = 3 world["settings_asset"]["StratePool"] = [ "/Standalone/Linux33/UpperFloatingIslands", "/Standalone/Linux33/MiddleSurfaceWorld", "/Standalone/Linux33/LowerTunnelNetwork", ] world["passages"] = [] # The L23 legacy coordinates are not part of this resolved stack. world["source"] = "VoxelForge Linux33 owner-like SurfaceWorld-upper fixture" OUT.mkdir(parents=True, exist_ok=True) path = OUT / f"sw-upper-tunnel-network-style{style}.json" path.write_text(json.dumps(world, separators=(",", ":")), encoding="utf-8") return path if __name__ == "__main__": for style in range(4): path = make_fixture(style) print(f"style={style} fixture={path}")