Class OverlayRegistry

java.lang.Object
net.minecraftforge.client.gui.OverlayRegistry

public class OverlayRegistry extends Object
  • Field Details

  • Constructor Details

    • OverlayRegistry

      public OverlayRegistry()
  • Method Details

    • registerOverlayBottom

      public static IIngameOverlay registerOverlayBottom(@Nonnull String displayName, @Nonnull IIngameOverlay overlay)
      Adds a new overlay entry to the registry, placed at the beginning of the list. Call from FMLClientSetupEvent. No need for enqueueWork.
      Parameters:
      displayName - A string for debug purposes, used primarily in exception traces coming from the overlays.
      overlay - An instance, lambda or method reference for the logic used in rendering the overlay.
      Returns:
      The same object passed into the overlay parameter.
    • registerOverlayBelow

      public static IIngameOverlay registerOverlayBelow(@Nonnull IIngameOverlay other, @Nonnull String displayName, @Nonnull IIngameOverlay overlay)
      Adds a new overlay entry to the registry, placed before the other parameter in the list. Call from FMLClientSetupEvent. No need for enqueueWork.
      Parameters:
      other - The overlay to insert before. The overlay must be registered.
      displayName - A string for debug purposes, used primarily in exception traces coming from the overlays.
      overlay - An instance, lambda or method reference for the logic used in rendering the overlay.
      Returns:
      The same object passed into the overlay parameter.
    • registerOverlayAbove

      public static IIngameOverlay registerOverlayAbove(@Nonnull IIngameOverlay other, @Nonnull String displayName, @Nonnull IIngameOverlay overlay)
      Adds a new overlay entry to the registry, placed after the other parameter in the list. Call from FMLClientSetupEvent. No need for enqueueWork.
      Parameters:
      other - The overlay to insert after. The overlay must be registered.
      displayName - A string for debug purposes, used primarily in exception traces coming from the overlays.
      overlay - An instance, lambda or method reference for the logic used in rendering the overlay.
      Returns:
      The same object passed into the overlay parameter.
    • registerOverlayTop

      public static IIngameOverlay registerOverlayTop(@Nonnull String displayName, @Nonnull IIngameOverlay overlay)
      Adds a new overlay entry to the registry, placed at the end of the list. Call from FMLClientSetupEvent. No need for enqueueWork.
      Parameters:
      displayName - A string for debug purposes, used primarily in exception traces coming from the overlays.
      overlay - An instance, lambda or method reference for the logic used in rendering the overlay.
      Returns:
      The same object passed into the overlay parameter.
    • registerOverlay

      private static IIngameOverlay registerOverlay(int sort, @Nullable IIngameOverlay other, @Nonnull String displayName, @Nonnull IIngameOverlay overlay)
    • enableOverlay

      public static void enableOverlay(@Nonnull IIngameOverlay overlay, boolean enable)
      Enables or disables an overlay. This is preferred over removing overlays.
      Parameters:
      overlay - The overlay object to enable or disable
      enable - The new state
    • getEntry

      @Nullable public static OverlayRegistry.OverlayEntry getEntry(@Nonnull IIngameOverlay overlay)
      Returns the information on a registered overlay.
      Parameters:
      overlay - The overlay to obtain the information for.
      Returns:
      The registration entry for this overlay.
    • orderedEntries

      public static List<OverlayRegistry.OverlayEntry> orderedEntries()
      Returns:
      Returns an unmodifiable view of the ordered list of entries.