Skip to content

[26.1] Move late stages of mod loading out of the first resource load#3003

Draft
XFactHD wants to merge 1 commit intoport/26.1from
finish_loading_before_resourceload
Draft

[26.1] Move late stages of mod loading out of the first resource load#3003
XFactHD wants to merge 1 commit intoport/26.1from
finish_loading_before_resourceload

Conversation

@XFactHD
Copy link
Member

@XFactHD XFactHD commented Mar 19, 2026

This PR moves the second and third stage of mod loading (CommonModLoader.load() and CommonModLoader.finish()) out of the initial resource reload, instead running it right before the initial reload is set up and executed. This ensures that loading errors in these stages don't cause the resource load to abort, restart in "safe mode" and then crash on completely unrelated follow-up issues, allowing us to instead capture the loading error and terminate immediately through the ELS error screen.
Moving these loading stages out of the resource reload allows us to remove the custom LoadingOverlay and therefore also (at least in theory) the "external GL texture import" extension patches.

I'm opening this as a draft for now for two reasons:

  • The error handling can only be properly tested after updating LWJGL in FML
  • ELS status messages in these two stages can currently not be shown because running DisplayWindow#periodicTick() after the window handover causes a weird lockup where the game seems to start fully (pausing it in the debugger ends up in vanilla GUI renderer code) but the window keeps showing the last ELS frame with the correct last status message and becomes completely unresponsive

@XFactHD XFactHD requested review from Technici4n and shartte March 19, 2026 17:53
@XFactHD XFactHD added enhancement New (or improvement to existing) feature or request breaking change Breaks binary compatibility area: loading Related to loading the game 26.1 Targeted at Minecraft 26.1 labels Mar 19, 2026
@neoforged-automation neoforged-automation bot removed the 26.1 Targeted at Minecraft 26.1 label Mar 19, 2026
@neoforged-pr-publishing
Copy link

  • Publish PR to GitHub Packages

@XFactHD XFactHD added the 26.1 Targeted at Minecraft 26.1 label Mar 19, 2026
@XFactHD XFactHD force-pushed the finish_loading_before_resourceload branch from b8a8217 to 035b55c Compare March 20, 2026 23:27
@XFactHD XFactHD force-pushed the finish_loading_before_resourceload branch from 035b55c to f4227df Compare March 20, 2026 23:54
@XFactHD
Copy link
Member Author

XFactHD commented Mar 21, 2026

With FML updated to LWJGL 3.4.1, the Swing/TinyFD-based path of early error reporting works in the moved mod loading stages. However, when the ELS is enabled and the error handling therefore uses its infrastructure then the game segfaults in the Nvidia driver on my system when the ELS theme used by the ErrorDisplayWindow tries to upload textures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

26.1 Targeted at Minecraft 26.1 area: loading Related to loading the game breaking change Breaks binary compatibility enhancement New (or improvement to existing) feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant