Skip to content

Support mcstructure format version 2 - #5

Open
HashimTheArab wants to merge 2 commits into
df-mc:masterfrom
HashimTheArab:update-mcstructure-v2
Open

Support mcstructure format version 2#5
HashimTheArab wants to merge 2 commits into
df-mc:masterfrom
HashimTheArab:update-mcstructure-v2

Conversation

@HashimTheArab

@HashimTheArab HashimTheArab commented Aug 29, 2026

Copy link
Copy Markdown

Summary

  • write .mcstructure files using format version 2 and NBT int-array block layers
  • omit the optional extra block layer when every entry is -1
  • continue reading version 1 list-based files and upgrade them when written
  • validate version-specific block layer counts and tag representations
  • modernise the module for Go 1.26 and current Dragonfly, worldupgrader, and gophertunnel releases

Evidence

Minecraft Preview 26.50.24 documents the v2 format: https://feedback.minecraft.net/hc/en-us/articles/47907593889677-Minecraft-Beta-Preview-26-50-24

Lens verification against client 1.26.50.26 found the matching read, write, and format-bound routines at RVAs 0x79f7050, 0x79f9cb0, and 0x79f7430. The exact-version implementation accepts one or two v2 layers, reads them as TAG_IntArray, and writes the second layer only when it contains a non--1 index. BDS 1.26.50.25 independently showed the same behavior.

Validation

  • read a shipped vanilla v1 bastion/mobs/hoglin.mcstructure and rewrote it as v2 with one TAG_IntArray layer
  • round-tripped a newly written one-layer v2 structure
  • round-tripped a newly written two-layer v2 structure with both layers encoded as TAG_IntArray
  • go test ./... -count=1 (builds successfully; repository has no test files)
  • go vet ./...
  • git diff --check

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.

1 participant