Skip to content

fix(26.3): support SDL headless launching - #431

Merged
okafke merged 3 commits into
headlesshq:mainfrom
yogurtreceptor:fix/minecraft-26.3-headless
Oct 3, 2026
Merged

okafke merged 3 commits into
headlesshq:mainfrom
yogurtreceptor:fix/minecraft-26.3-headless

Conversation

@yogurtreceptor

@yogurtreceptor yogurtreceptor commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

fix(26.3): support SDL headless launching

Minecraft 26.3 fails to start with -lwjgl because the existing redirections
cannot supply the SDL window values and RenderPearl graphics providers it
expects. LWJGL 3.4.3 also contains Java 27 entries that the current ASM cannot
read.

This updates ASM and adds the SDL, buffer and graphics-provider redirections
needed to load a world without rendering. Virtual window queries retain size,
position, fullscreen and mouse state; SDL swap uses hmc.lwjgl.update_sleep.

On macOS, a small Java agent skips the new native window-menu setup, which
cannot run against a virtual window. Transforming at class loading keeps signed
game jars intact and covers NeoForge's separately patched jar. The executable
wrapper also installs the hook before same-process launches on Java 9 or later.
That hook checks for the SDL redirections in the game class loader, preserving
the menu method for graphical clients. Custom same-process hosts need to
install the agent at JVM startup.

Validation:

  • Build and integration checks passed, including Java 8, Java 21 coverage/integration, older Minecraft checks and packaging.
  • 26.3 platform checks passed all twelve jobs: Fabric, NeoForge and Forge without rendering on Linux, Windows and macOS, plus three Linux rendering jobs under Xvfb with Mesa llvmpipe. Every game log records one completed GameTest, zero failures and shutdown saves.
  • macOS same-process checks passed with Fabric on 26.3 and 26.2. The 26.3 run completed the GameTest; both saved and exited. A local signed-class fixture also checks that the wrapper preserves the original jar and ordinary menu method, and still starts on Java 8.

The workflow adds the three 26.3 loaders and keeps 26.2 coverage. Its no-render
command now passes -lwjgl explicitly and requires one GameTest for 26.3.
The 26.3 source-build job needs the companion module from
headlesshq/mc-runtime-test#152
on upstream main. That PR adds the module/build entry; activation of the
companion's 26.3 runtime jobs waits for a compatible HeadlessMC release.

No-render mode skips shader compilation and reflection with drawing. It warns
that shader errors are not checked; these smoke tests do not validate
screenshots or gameplay mods. Same-process launching remains beta, with the
macOS check covering Fabric. The first-run accessibility introduction can
speak while the regular narrator is off, as it does in 26.2; the headless setup
documentation now includes the corresponding options.

@yogurtreceptor yogurtreceptor changed the title fix(26.3): support headless startup and server connections fix(26.3): support SDL headless launching Sep 27, 2026
@yogurtreceptor
yogurtreceptor marked this pull request as ready for review September 27, 2026 10:46
@okafke

okafke commented Sep 29, 2026

Copy link
Copy Markdown
Member

Thanks a lot for this, I will need some time to check and review

@okafke
okafke merged commit 6cfe18e into headlesshq:main Oct 3, 2026
111 of 124 checks passed
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.

2 participants