vanilla_client: this machine's natives when prepared.json lists another's

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Horizon agentandClaude Opus 5.5 committed 2026-11-05 17:57:02 +01:00
1 parent 6039812a76
commit 44c13ed7ac
1 file changed
+11 -1
+11 -1
View File
@@ -65,9 +65,19 @@ def host_library(path):
return "java-objc-bridge" not in name
def host_natives(path):
"""A natives jar for this machine in place of another platform's: a prepared.json made on one machine
and shared with others (a shared .local) lists that machine's natives only; the jars sit side by side."""
name = Path(path).name
if "-natives-" not in name or name.endswith(NATIVES):
return path
mine = Path(path).with_name(name[:name.index("-natives-") + 1] + NATIVES)
return str(mine) if (ROOT / mine).exists() else path
def classpath():
prepared = json.loads((GAME / "prepared.json").read_text())
jars = [ROOT / p for p in prepared["libraries"]["client"] if host_library(p)]
jars = [ROOT / p for p in map(host_natives, prepared["libraries"]["client"]) if host_library(p)]
return [GAME / "jars/client.jar", *jars]