Prepare: accept Mojang's republished 26.3 asset indexes (sounds, panorama)
Mojang republished the 26.3 version JSON again (sha1 61fff131), with a new asset index 34 (0c8f43b2) that changes only 142 translation files. A launcher keeps one indexes/34.json, so every install made since then, official launcher or Prism, failed the "pinned asset index" check: no sounds and no title panorama. - research-lock.json: accept the new version JSON, and list the asset indexes of every accepted version JSON (accepted_asset_index_sha1). - horizon-prepare: an index the lock does not know is still used, with a line in the log, since every object copied from it is checked against its own SHA-1; the sounds now require minecraft/sounds.json in the index. - tools/lab.py: the same for the dev tools. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+7
-3
@@ -237,14 +237,18 @@ def import_library(artifact, destination_root, minecraft=None):
|
||||
|
||||
|
||||
def launcher_assets(manifest, minecraft=None):
|
||||
"""The launcher's asset directory and the pinned version's verified asset index."""
|
||||
"""The launcher's asset directory and the pinned version's asset index."""
|
||||
assets = minecraft_dir(minecraft) / "assets"
|
||||
info = manifest["assetIndex"]
|
||||
index = assets / "indexes" / f"{info['id']}.json"
|
||||
if not index.is_file():
|
||||
raise FileNotFoundError(f"Missing {index}. {LAUNCHER_HINT.format(version=manifest['id'])}")
|
||||
if digest(index, "sha1") != info["sha1"]:
|
||||
raise ValueError(f"{index} is not the pinned asset index")
|
||||
checksum = digest(index, "sha1")
|
||||
known = json.loads(LOCK.read_text(encoding="utf-8"))["minecraft"].get("accepted_asset_index_sha1", [])
|
||||
if checksum != info["sha1"] and checksum not in known:
|
||||
# Mojang republishes an index under the same id (#1076); each object is still verified.
|
||||
print(f"{index} is an asset index Horizon does not know yet (sha1 {checksum}); "
|
||||
"using it, every file is still checked against its own SHA-1", file=sys.stderr)
|
||||
return assets, index
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user