4. Absorb mcwb into mciwb#

Date: 2026-11-30

Status#

Accepted. Supersedes the parts of 3. Keep mcipc for RCON, take block identifiers from mcwb that are about mcwb.

Context#

mcwb was meant to be the geometry layer under mciwb. It no longer split cleanly from it:

  • mciwb’s builders used mcwb only for its types (Vec3, Volume, Item, Direction) and get_block. Placer writes its own commands.

  • mciwb’s Schematic and mciwb.anvil had replaced mcwb’s Blocks, grab and JSON item lists.

  • Nothing but mciwb used mcwb.

Keeping it as a separate package cost a release step, a version pin (MINECRAFT_VERSION had to match), a second docs site and a git dependency, which PyPI rejects.

mcwb is GPL-3.0-or-later and mciwb is Apache-2.0. At the pinned commit (1f2c017), 221 of mcwb’s lines were by authors other than mciwb’s owner, mostly in Vec3 and the profile extruder. The owner can relicense their own code, but not those lines.

Decision#

  • Move mcwb’s code into mciwb and drop the mcwb dependency. mcipc stays, as in ADR 3.

    • mciwb.geometry: Vec3, Direction, Anchor3, Planes3d, Volume, and the Row, Profile and Cuboid types.

    • mciwb.item: Item and MINECRAFT_VERSION, generated by scripts/generate_items.py.

    • mciwb.shapes: polygon and the profile helpers.

    • mciwb.cuboids: Blocks, grab, get_block, save_items and load_items. This module is frozen: Schematic is its successor.

  • mciwb stays Apache-2.0. The owner’s code moves across as it is. The other authors’ lines are not copied: they are rewritten clean-room.

    • One agent read the original and wrote a behaviour spec that holds no code.

    • A second agent, which never saw the original, wrote the replacements from the spec.

    • A differential test runs both versions on the same inputs and shows that they behave the same. An independent verifier checked the result.

  • Drop make_tunnel and the helpers that only it used (offsets, normalize, get_direction, Anchor). polygon keeps a private _extrude. Placer and the builders cover what make_tunnel was used for.

  • Every other name in mciwb.imports stays, so scripts that import from there do not change.

Consequences#

  • One package, one release and one docs site. mciwb can be published to PyPI again, because it has no git dependency.

  • When a new Minecraft release adds blocks, run scripts/generate_items.py in mciwb. A unit test checks that MINECRAFT_VERSION matches the server image.

  • The rewritten code keeps the behaviour of the original, including its quirks (for example, Vec3 has no reflected operators, so 1 + vec raises TypeError). Changes to that behaviour are separate issues.

  • Some of Vec3’s one-line methods read almost the same as the original, because each is the only natural way to write behaviour that the spec fully determines.

  • Scripts that call make_tunnel must change. Scripts that import mcwb directly switch to mciwb.imports.

  • The mcwb repository is archived, with a pointer to mciwb.