Package net.minecraftforge.client.gui
Class OverlayRegistry
java.lang.Object
net.minecraftforge.client.gui.OverlayRegistry
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static Map<IIngameOverlay,OverlayRegistry.OverlayEntry>private static List<OverlayRegistry.OverlayEntry> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidenableOverlay(IIngameOverlay overlay, boolean enable)Enables or disables an overlay.static OverlayRegistry.OverlayEntrygetEntry(IIngameOverlay overlay)Returns the information on a registered overlay.static List<OverlayRegistry.OverlayEntry>private static IIngameOverlayregisterOverlay(int sort, IIngameOverlay other, String displayName, IIngameOverlay overlay)static IIngameOverlayregisterOverlayAbove(IIngameOverlay other, String displayName, IIngameOverlay overlay)Adds a new overlay entry to the registry, placed after theotherparameter in the list.static IIngameOverlayregisterOverlayBelow(IIngameOverlay other, String displayName, IIngameOverlay overlay)Adds a new overlay entry to the registry, placed before theotherparameter in the list.static IIngameOverlayregisterOverlayBottom(String displayName, IIngameOverlay overlay)Adds a new overlay entry to the registry, placed at the beginning of the list.static IIngameOverlayregisterOverlayTop(String displayName, IIngameOverlay overlay)Adds a new overlay entry to the registry, placed at the end of the list.
-
Field Details
-
overlays
-
overlaysOrdered
-
-
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 fromFMLClientSetupEvent. 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
overlayparameter.
-
registerOverlayBelow
public static IIngameOverlay registerOverlayBelow(@Nonnull IIngameOverlay other, @Nonnull String displayName, @Nonnull IIngameOverlay overlay)Adds a new overlay entry to the registry, placed before theotherparameter in the list. Call fromFMLClientSetupEvent. 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
overlayparameter.
-
registerOverlayAbove
public static IIngameOverlay registerOverlayAbove(@Nonnull IIngameOverlay other, @Nonnull String displayName, @Nonnull IIngameOverlay overlay)Adds a new overlay entry to the registry, placed after theotherparameter in the list. Call fromFMLClientSetupEvent. 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
overlayparameter.
-
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 fromFMLClientSetupEvent. 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
overlayparameter.
-
registerOverlay
private static IIngameOverlay registerOverlay(int sort, @Nullable IIngameOverlay other, @Nonnull String displayName, @Nonnull IIngameOverlay overlay) -
enableOverlay
Enables or disables an overlay. This is preferred over removing overlays.- Parameters:
overlay- The overlay object to enable or disableenable- The new state
-
getEntry
Returns the information on a registered overlay.- Parameters:
overlay- The overlay to obtain the information for.- Returns:
- The registration entry for this overlay.
-
orderedEntries
- Returns:
- Returns an unmodifiable view of the ordered list of entries.
-