Interface ImmediateWindowProvider

All Superinterfaces:
EarlyLoadingScreenController

public interface ImmediateWindowProvider extends 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 Details

    • name

      String name()
      Returns:
      The name of this window provider. Do NOT use fmlearlywindow.
    • initialize

      void initialize(ProgramArgs args)
      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

      void setMinecraftVersion(String version)
      Sets the Minecraft version, once it has been determined. This may be some time after initialize(net.neoforged.fml.loading.ProgramArgs) was called, or never, if Minecraft can't be found.
    • setNeoForgeVersion

      void setNeoForgeVersion(String version)
      Sets the NeoForge version, once it has been determined. This may be some time after initialize(net.neoforged.fml.loading.ProgramArgs) was called, or never, if NeoForge can't be found.
    • crash

      void crash(String message)
      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 occurred
      modsFolder - The path to the mods folder
      logFile - The path to the latest.log file
      crashReportFile - The path to the crash report of the fatal error