Forge: fall back to the run jar when there is no @args launcher (#42) - #56
Merged
Conversation
Forge: fall back to the run jar when there is no @Args launcher (#42) Pre-1.17 Forge (<=1.16.5) does not emit an OS @Args file; the installer produces a runnable server jar instead. createServer only ever looked for win_args.txt/unix_args.txt and threw installer-args-not-found for those versions even though the install succeeded. - New pure, unit-testable pickForgeRunJar() in serverDetect: given the top-level jar listing, pick the produced forge/neoforge run jar (universal on <=1.12, forge-<mcver>-<forgever>.jar on 1.13-1.16), skipping the installer jar itself. - createServer: if no @Args file is found after the installer runs, fall back to launching that jar with -jar; only throw when neither exists. 1.17+ Forge / NeoForge keep the @Args path unchanged. - universal-first ordering is safe only because listJars is top-level only (documented in a comment so nobody makes it recursive). - WIZARD smoke: cover the jar-vs-args decision (universal / loader / none, installer excluded, vanilla server jar never picked, neoforge keyword). Scope: this fixes the installer-args-not-found failure only. Actually launching an old-Forge server also needs a compatible JRE (Java 8), which is the Java-provisioning / #44 matrix concern, not this change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> @
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #42. Part of the provider-reliability pass (#44).
Problem
Creating a Forge server failed with
installer-args-not-foundon pre-1.17 versions. After the installer runs,createServeronly looked for an OS@argsfile (win_args.txt/unix_args.txt), which is emitted by Forge 1.17+ / NeoForge only. Older Forge (≤ 1.16.5) instead produces a runnable server jar, so the lookup returned null and creation always failed even though the install succeeded.Fix
pickForgeRunJar()inserverDetect.ts: given the top-level jar listing, pick the produced forge/neoforge run jar (a-universal.jaron ≤ 1.12,forge-<mcver>-<forgever>.jaron 1.13–1.16), skipping the installer jar itself and never a plain vanillaminecraft_server.*.jar.createServer: if no@argsfile is found after the installer runs, fall back to launching that jar with-jar; only throwinstaller-args-not-foundwhen neither an args file nor a run jar exists. 1.17+ Forge / NeoForge keep the@argspath unchanged.-universal-first ordering is correct only becauselistJarsis top-level only (on 1.13–1.16 a-universal.jarexists but underlibraries/, so it must stay out of scope). Documented in a comment so it isn't made recursive.Verify — and its limits
typecheck,build— pass.MSMS_SMOKE_WIZARDPASS, including a new block that exercises the jar-vs-args decision: universal (≤1.12) / loader jar (1.13–1.16) / none (1.17+ installer-only) / installer excluded / vanilla jar never picked / neoforge keyword.forge-<mcver>-<forgever>.jar) was cross-checked against Forge community docs.installer-args-not-foundfailure only. Actually launching an old-Forge server additionally needs a compatible JRE (Java 8) — that is the Java-provisioning / hardening-matrix concern (Harden server creation across the whole version/loader matrix (umbrella) #44), not this change.🤖 Generated with Claude Code