Class NeoForgeLoadingOverlay

All Implemented Interfaces:
Renderable

public class NeoForgeLoadingOverlay extends LoadingOverlay
This is an implementation of the LoadingOverlay that calls back into the early window rendering, as part of the game loading cycle. We completely replace the render(GuiGraphics, int, int, float) call from the parent with one of our own, that allows us to blend our early loading screen into the main window, in the same manner as the Mojang screen. It also allows us to see and tick appropriately as the later stages of the loading system run. It is somewhat a copy of the superclass render method.
  • Field Details

    • minecraft

      private final Minecraft minecraft
    • reload

      private final ReloadInstance reload
    • onFinish

      private final Consumer<Optional<Throwable>> onFinish
    • displayWindow

      private final net.neoforged.fml.earlydisplay.DisplayWindow displayWindow
    • progressMeter

      private final net.neoforged.fml.loading.progress.ProgressMeter progressMeter
    • currentProgress

      private float currentProgress
    • fadeOutStart

      private long fadeOutStart
  • Constructor Details

  • Method Details

    • newInstance

      public static Supplier<LoadingOverlay> newInstance(Supplier<Minecraft> mc, Supplier<ReloadInstance> ri, Consumer<Optional<Throwable>> handler, net.neoforged.fml.earlydisplay.DisplayWindow window)
    • render

      public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTick)
      Description copied from class: LoadingOverlay
      Renders the graphical user interface (GUI) element.
      Specified by:
      render in interface Renderable
      Overrides:
      render in class LoadingOverlay
      Parameters:
      graphics - the GuiGraphics object used for rendering.
      mouseX - the x-coordinate of the mouse cursor.
      mouseY - the y-coordinate of the mouse cursor.
      partialTick - the partial tick time.
    • addQuad

      private static void addQuad(VertexConsumer bufferbuilder, float x0, float x1, float y0, float y1, net.neoforged.fml.earlydisplay.ColourScheme.Colour colour, float fade)