Tools read the pinned Minecraft version from research-lock.json

lab.VERSION, lab.GAME (.local/minecraft/<version>) and lab.RESOURCES
(.local/horizon-client/<version>) come from the lock, and lab.version_info()
reads the pinned client jar's version.json. Every harness, generator and
tool that named 26.3 (resource folders, jar and source paths, result
records, the vanilla client's --version and asset index, the bare login
client's protocol, the benchmark's options.txt data version, the packet id
table's header) uses them, so a candidate worktree pinned to another version
runs them unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-15 17:49:54 +02:00
parent ef8b045d79
commit ce87bfb8c7
62 changed files with 238 additions and 89 deletions
+8 -3
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""Convert vanilla's BlockStateData.java into a plain data file.
Reads .local/minecraft/26.3/sources/server/net/minecraft/util/datafix/fixes/BlockStateData.java
Reads .local/minecraft/<pinned version>/sources/server/net/minecraft/util/datafix/fixes/BlockStateData.java
Writes crates/horizon-world/src/datafix/block_state_data.txt
Output: UTF-8, '#' header lines, then one line per register() call, in the order the
@@ -20,8 +20,13 @@ import re
import sys
from pathlib import Path
try:
from . import lab
except ImportError:
import lab
REPO = Path(__file__).resolve().parent.parent
DEFAULT_JAVA = REPO / ".local/minecraft/26.3/sources/server/net/minecraft/util/datafix/fixes/BlockStateData.java"
DEFAULT_JAVA = lab.GAME / "sources/server/net/minecraft/util/datafix/fixes/BlockStateData.java"
DEFAULT_OUT = REPO / "crates/horizon-world/src/datafix/block_state_data.txt"
TOKEN_RE = re.compile(
@@ -305,7 +310,7 @@ def main():
raise SystemExit(f"create count mismatch: textual {textual_create}, parsed {total_create}")
header = [
"# Generated by tools/gen_block_state_data.py from vanilla 26.3 BlockStateData.java. Do not edit.",
f"# Generated by tools/gen_block_state_data.py from vanilla {lab.VERSION} BlockStateData.java. Do not edit.",
"# One line per register(ID, new, legacy...) call, in execution order of the static initializer",
"# (bootstrap0, 1, 2, 3_1, 3_2, 4 .. 9, A .. F).",
"# Format (tab separated): ID <TAB> newName <TAB> newProps [<TAB> legacyName <TAB> legacyProps]...",