Skip to content

Add real-tool .schem fixtures, flat-v3 codec support and importer tests - #24

Merged
lzif merged 1 commit into
mainfrom
feat/real-schem-fixtures
Nov 16, 2026
Merged

lzif merged 1 commit into
mainfrom
feat/real-schem-fixtures

Conversation

@lzif

@lzif lzif commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Closes #10
Closes #11

Summary

  • Real-tool .schem & .schematic fixtures added under fixtures/real/:
    • worldedit/fantasyhouse2.schem: WorldEdit 7.4.6 (enginehub:fabric), Sponge v3, DataVersion 5023 (44×39×34, Offset: [-18, -13, -32], 22,953 blocks, 342 palette entries exercising 2-byte varints, 93 block entities, 41 entities)
    • shulkr/{castelo-medieval,raifox-medivial-house,simple-survival-mansion}.schem: Sponge v3 builds exported by Shulkr (DataVersion 5023)
    • flat-v3/smp_lobby_{big,center_dense,medieval}.schem: real-world .schem files (DataVersion 3465) that stamp Version: 3 on a flat Sponge v2 layout
    • legacy/storageroom-medieval.schematic: real pre-1.13 MCEdit Materials: "Alpha" file for legacy rejection testing
  • Flat-v3 compatibility in readSchem (packages/core/src/codecs/schem.ts):
    • Accepts flat Sponge v2 layout (Palette compound + BlockData byte array at top level, without Schematic/Blocks) when Version === 3, reading via v2 layout and emitting "Version is 3, but layout is Sponge v2 (read using v2 layout)", while still rejecting mismatched or malformed headers.
    • Rebuilt standalone bundle skills/voxwright/scripts/voxwright-cli.mjs.
  • Tests & Docs:
    • packages/core/test/real-fixtures.test.ts & schem.test.ts: fixture decoding, metadata/entity preservation, format round-trips, flat-v3 layout warning, and legacy rejection.
    • packages/core/test/convert.test.ts: real .schem -> .nbt and flat-v3 warning tests.
    • packages/mcbuilder/test/importer.test.ts: end-to-end tests running scripts/convert.ts on fantasyhouse2.schem, raifox-medivial-house.schem, and smp_lobby_big.schem, feeding the .nbt outputs into mcbuilder's importer, and verifying block-for-block identity (plus 1.20 minecraft:chain -> minecraft:iron_chain rename handling).
    • packages/mcbuilder/test/skill-cli.test.ts: voxwright-cli inspect checks on real WorldEdit and flat-v3 .schem files.
    • Updated fixtures/README.md, PLAN.md, and README.md.

Verification (rebased onto d3d1f4e)

  • pnpm run check (0 errors, exit 0) & pnpm exec biome format . (0 errors)
  • pnpm run depcheck (397 modules, 1133 dependencies cruised, 0 violations)
  • pnpm run typecheck (core, render, web, mcbuilder, scripts — 0 errors)
  • node scripts/build-skill.ts --check & node scripts/pack-npm.ts --dry-run
  • pnpm test (71 passed (71), 1917 passed | 190 skipped (2107))

Add the real-tool .schem and legacy .schematic fixtures from schem-file.zip under fixtures/real/:
- fixtures/real/worldedit/fantasyhouse2.schem (WorldEdit 7.4.6, Sponge v3, DataVersion 5023)
- fixtures/real/shulkr/{castelo-medieval,raifox-medivial-house,simple-survival-mansion}.schem (Shulkr, Sponge v3)
- fixtures/real/flat-v3/smp_lobby_{big,center_dense,medieval}.schem (flat Sponge v2 layout stamped Version 3)
- fixtures/real/legacy/storageroom-medieval.schematic (pre-1.13 MCEdit Alpha format)

Update readSchem() to accept real-world .schem files that declare Version 3 while using Sponge v2's flat top-level layout (Palette and BlockData without Schematic/Blocks) with a warning, and rebuild skills/voxwright/scripts/voxwright-cli.mjs.

Add real-fixture, convert, skill-CLI inspect, and end-to-end scripts/convert.ts -> mcbuilder importer tests verifying block-for-block identity across real .schem builds (issues #10 and #11).
@lzif
lzif force-pushed the feat/real-schem-fixtures branch from e37e1f0 to 50555e7 Compare November 16, 2026 10:27
@lzif
lzif merged commit 1339c9d into main Nov 16, 2026
6 checks passed
@lzif
lzif deleted the feat/real-schem-fixtures branch November 16, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fixtures: real-tool .schem files convert script: .schem to .nbt

1 participant