Skip to content

v0.2.0 — diff + patch/restore

Choose a tag to compare

@BangRocket BangRocket released this 03 Jun 16:28
· 206 commits to main since this release

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 (--expand for per-index).
  • Colored unified output (auto-off when piped) or --json; --only, --summary. Exit 0/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). --reverse restores old state; --force, --dry-run, --only.
  • New write path (RegionWriter + ChunkCodec.Encode), Nbt/ utilities (NbtJson, NbtPath, NbtEquality, NbtIdentity), and a single IDiffSink walk driving both diff and extract.

Quality

  • 48 xUnit tests. Forward/reverse round-trips verified end-to-end on real worlds: extract Older→Newer + apply reproduces Newer exactly; apply --reverse reproduces Older.

Requires .NET 9. See the README for usage and a worked example.