Skip to content

Forge: fall back to the run jar when there is no @args launcher (#42) - #56

Merged
CaYatur merged 1 commit into
mainfrom
fix/forge-pre117-runjar
Jul 24, 2026
Merged

Forge: fall back to the run jar when there is no @args launcher (#42)#56
CaYatur merged 1 commit into
mainfrom
fix/forge-pre117-runjar

Conversation

@CaYatur

@CaYatur CaYatur commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Closes #42. Part of the provider-reliability pass (#44).

Problem

Creating a Forge server failed with installer-args-not-found on pre-1.17 versions. After the installer runs, createServer only looked for an OS @args file (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

  • New pure, unit-testable pickForgeRunJar() in serverDetect.ts: given the top-level jar listing, pick the produced forge/neoforge run jar (a -universal.jar on ≤ 1.12, forge-<mcver>-<forgever>.jar on 1.13–1.16), skipping the installer jar itself and never a plain vanilla minecraft_server.*.jar.
  • createServer: if no @args file is found after the installer runs, fall back to launching that jar with -jar; only throw installer-args-not-found when neither an args file nor a run jar exists. 1.17+ Forge / NeoForge keep the @args path unchanged.
  • The -universal-first ordering is correct only because listJars is top-level only (on 1.13–1.16 a -universal.jar exists but under libraries/, 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_WIZARD PASS, 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.
  • Honesty note: the smoke tests the selection logic against the filename shapes from the issue spec + Forge docs — it does not run the real installer (old Forge needs a JDK 8 toolchain not available here). The 1.16.5 run-jar name (forge-<mcver>-<forgever>.jar) was cross-checked against Forge community docs.
  • Scope: this resolves the installer-args-not-found failure 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

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>
@
Copilot AI review requested due to automatic review settings July 24, 2026 15:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@CaYatur
CaYatur merged commit 661f905 into main Jul 24, 2026
1 check passed
@CaYatur
CaYatur deleted the fix/forge-pre117-runjar branch July 24, 2026 15:21
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.

Forge creation fails with installer-args-not-found on pre-1.17 versions

2 participants