Interface ImmediateWindowProvider
- All Superinterfaces:
EarlyLoadingScreenController
This is for allowing the plugging in of alternative early display implementations.
They can be selected through the config value "earlyWindowProvider" which defaults to "fmlearlywindow".
There are a few key things to keep in mind if following through on implementation. You cannot access the game state as it
literally DOES NOT EXIST at the time this object is constructed. You have to be very careful about managing the handoff
to mojang, be sure that if you're trying to tick your window in a background thread (a nice idea!) that you properly
transition to the main thread before handoff is complete. Do note that in general, you should construct your GL objects
on the MAIN thread before starting your ticker, to ensure MacOS compatibility.
No doubt many more things can be said here.
-
Method Summary
Modifier and TypeMethodDescriptionvoidThis is called during some very early startup routines to show a crash dialog using e.g. tinyfd dialogsvoiddisplayFatalErrorAndExit(List<ModLoadingIssue> issues, @Nullable Path modsFolder, @Nullable Path logFile, @Nullable Path crashReportFile) This is called when a fatal loading error occurs to show a MC-independent loading error screen and then terminate the game.voidinitialize(ProgramArgs args) This is called very early on to initialize ourselves.name()voidsetMinecraftVersion(String version) Sets the Minecraft version, once it has been determined.voidsetNeoForgeVersion(String version) Sets the NeoForge version, once it has been determined.Methods inherited from interface net.neoforged.fml.loading.EarlyLoadingScreenController
completeProgress, periodicTick, takeOverGlfwWindow, updateProgress
-
Method Details
-
name
String name()- Returns:
- The name of this window provider. Do NOT use fmlearlywindow.
-
initialize
This is called very early on to initialize ourselves. Use this to initialize the window and other GL core resources.- Parameters:
args- The current program arguments. You can mutate this.
-
setMinecraftVersion
Sets the Minecraft version, once it has been determined. This may be some time afterinitialize(net.neoforged.fml.loading.ProgramArgs)was called, or never, if Minecraft can't be found. -
setNeoForgeVersion
Sets the NeoForge version, once it has been determined. This may be some time afterinitialize(net.neoforged.fml.loading.ProgramArgs)was called, or never, if NeoForge can't be found. -
crash
This is called during some very early startup routines to show a crash dialog using e.g. tinyfd dialogs- Parameters:
message- The message to display
-
displayFatalErrorAndExit
void displayFatalErrorAndExit(List<ModLoadingIssue> issues, @Nullable @Nullable Path modsFolder, @Nullable @Nullable Path logFile, @Nullable @Nullable Path crashReportFile) This is called when a fatal loading error occurs to show a MC-independent loading error screen and then terminate the game.- Parameters:
issues- The loading issues that occurredmodsFolder- The path to the mods folderlogFile- The path to the latest.log filecrashReportFile- The path to the crash report of the fatal error
-