Repository navigation
v0.2.0 — diff + patch/restore
First tagged release of mcadiff — a semantic, git-style diff and patch/restore tool for Anvil-format Minecraft (Java Edition) worlds.
Diff
- Element-by-element diff of two worlds:
region/+entities/+poi/across all dimensions, plus loose NBT (level.dat,playerdata/*.dat,data/*.dat). - Recurses the full NBT tree to leaf level; compounds matched by key, set-like lists matched by identity (block coords, entity UUID, inventory slot, string
id) else by index; packed arrays summarized (--expandfor per-index). - Colored unified output (auto-off when piped) or
--json;--only,--summary. Exit0/1/2. - Fast paths skip byte-identical files and byte-identical compressed chunks; a ~2,900-file self-diff runs in seconds.
Patch & restore (new)
mcadiff extract <old> <new> -o changes.mcapatch— portable, bidirectional patch (each op stores old + new, losslessly type-encoded).mcadiff apply <patch> <target> -o <out>— non-destructive: copies the target to a fresh output world and rewrites only the patched nodes, each 3-way guarded (mismatch → conflict, skipped, never clobbered).--reverserestores old state;--force,--dry-run,--only.- New write path (
RegionWriter+ChunkCodec.Encode),Nbt/utilities (NbtJson,NbtPath,NbtEquality,NbtIdentity), and a singleIDiffSinkwalk driving both diff and extract.
Quality
- 48 xUnit tests. Forward/reverse round-trips verified end-to-end on real worlds:
extractOlder→Newer +applyreproduces Newer exactly;apply --reversereproduces Older.
Requires .NET 9. See the README for usage and a worked example.