Class RegisterGuiOverlaysEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.RegisterGuiOverlaysEvent
- All Implemented Interfaces:
net.neoforged.fml.event.IModBusEvent
public class RegisterGuiOverlaysEvent
extends net.neoforged.bus.api.Event
implements net.neoforged.fml.event.IModBusEvent
Allows users to register custom
GUI overlays
.
This event is not cancellable, and does not have a result.
This event is fired on the mod-specific event bus, only on the logical client.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.neoforged.bus.api.Event
net.neoforged.bus.api.Event.HasResult, net.neoforged.bus.api.Event.Result
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<ResourceLocation>
private final Map<ResourceLocation,
IGuiOverlay> -
Constructor Summary
ConstructorsConstructorDescriptionRegisterGuiOverlaysEvent
(Map<ResourceLocation, IGuiOverlay> overlays, List<ResourceLocation> orderedOverlays) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
register
(@NotNull RegisterGuiOverlaysEvent.Ordering ordering, @Nullable ResourceLocation other, @NotNull ResourceLocation key, @NotNull IGuiOverlay overlay) void
registerAbove
(@NotNull ResourceLocation other, @NotNull String id, @NotNull IGuiOverlay overlay) Deprecated, for removal: This API element is subject to removal in a future version.void
registerAbove
(@NotNull ResourceLocation other, @NotNull ResourceLocation id, @NotNull IGuiOverlay overlay) Registers an overlay that renders above another.void
registerAboveAll
(@NotNull String id, @NotNull IGuiOverlay overlay) Deprecated, for removal: This API element is subject to removal in a future version.Usethe RL-explicit variant
instead; mod ID inference will be removed in a later update, alongside the move of registration events to the NeoForge main busvoid
registerAboveAll
(@NotNull ResourceLocation id, @NotNull IGuiOverlay overlay) Registers an overlay that renders above all others.void
registerBelow
(@NotNull ResourceLocation other, @NotNull String id, @NotNull IGuiOverlay overlay) Deprecated, for removal: This API element is subject to removal in a future version.Usethe RL-explicit variant
instead; mod ID inference will be removed in a later update, alongside the move of registration events to the NeoForge main busvoid
registerBelow
(@NotNull ResourceLocation other, @NotNull ResourceLocation id, @NotNull IGuiOverlay overlay) Registers an overlay that renders below another.void
registerBelowAll
(@NotNull String id, @NotNull IGuiOverlay overlay) Deprecated, for removal: This API element is subject to removal in a future version.Usethe RL-explicit variant
instead; mod ID inference will be removed in a later update, alongside the move of registration events to the NeoForge main busvoid
registerBelowAll
(@NotNull ResourceLocation id, @NotNull IGuiOverlay overlay) Registers an overlay that renders below all others.Methods inherited from class net.neoforged.bus.api.Event
getResult, hasResult, setResult
-
Field Details
-
overlays
-
orderedOverlays
-
-
Constructor Details
-
RegisterGuiOverlaysEvent
@Internal public RegisterGuiOverlaysEvent(Map<ResourceLocation, IGuiOverlay> overlays, List<ResourceLocation> orderedOverlays)
-
-
Method Details
-
registerBelowAll
@Deprecated(forRemoval=true, since="1.20.2") public void registerBelowAll(@NotNull @NotNull String id, @NotNull @NotNull IGuiOverlay overlay) Deprecated, for removal: This API element is subject to removal in a future version.Usethe RL-explicit variant
instead; mod ID inference will be removed in a later update, alongside the move of registration events to the NeoForge main busRegisters an overlay that renders below all others.- Parameters:
id
- A unique resource id for this overlayoverlay
- The overlay
-
registerBelowAll
public void registerBelowAll(@NotNull @NotNull ResourceLocation id, @NotNull @NotNull IGuiOverlay overlay) Registers an overlay that renders below all others.- Parameters:
id
- A unique resource id for this overlayoverlay
- The overlay
-
registerBelow
@Deprecated(forRemoval=true, since="1.20.2") public void registerBelow(@NotNull @NotNull ResourceLocation other, @NotNull @NotNull String id, @NotNull @NotNull IGuiOverlay overlay) Deprecated, for removal: This API element is subject to removal in a future version.Usethe RL-explicit variant
instead; mod ID inference will be removed in a later update, alongside the move of registration events to the NeoForge main busRegisters an overlay that renders below another.- Parameters:
other
- The id of the overlay to render below. This must be an overlay you have already registered or avanilla overlay
. Do not use other mods' overlays.id
- A unique resource id for this overlayoverlay
- The overlay
-
registerBelow
public void registerBelow(@NotNull @NotNull ResourceLocation other, @NotNull @NotNull ResourceLocation id, @NotNull @NotNull IGuiOverlay overlay) Registers an overlay that renders below another.- Parameters:
other
- The id of the overlay to render below. This must be an overlay you have already registered or avanilla overlay
. Do not use other mods' overlays.id
- A unique resource id for this overlayoverlay
- The overlay
-
registerAbove
@Deprecated(forRemoval=true, since="1.20.2") public void registerAbove(@NotNull @NotNull ResourceLocation other, @NotNull @NotNull String id, @NotNull @NotNull IGuiOverlay overlay) Deprecated, for removal: This API element is subject to removal in a future version.Usethe RL-explicit variant
instead; mod ID inference will be removed in a later update, alongside the move of registration events to the NeoForge main busRegisters an overlay that renders above another.- Parameters:
other
- The id of the overlay to render above. This must be an overlay you have already registered or avanilla overlay
. Do not use other mods' overlays.id
- A unique resource id for this overlayoverlay
- The overlay
-
registerAbove
public void registerAbove(@NotNull @NotNull ResourceLocation other, @NotNull @NotNull ResourceLocation id, @NotNull @NotNull IGuiOverlay overlay) Registers an overlay that renders above another.- Parameters:
other
- The id of the overlay to render above. This must be an overlay you have already registered or avanilla overlay
. Do not use other mods' overlays.id
- A unique resource id for this overlayoverlay
- The overlay
-
registerAboveAll
@Deprecated(forRemoval=true, since="1.20.2") public void registerAboveAll(@NotNull @NotNull String id, @NotNull @NotNull IGuiOverlay overlay) Deprecated, for removal: This API element is subject to removal in a future version.Usethe RL-explicit variant
instead; mod ID inference will be removed in a later update, alongside the move of registration events to the NeoForge main busRegisters an overlay that renders above all others.- Parameters:
id
- A unique resource id for this overlayoverlay
- The overlay
-
registerAboveAll
public void registerAboveAll(@NotNull @NotNull ResourceLocation id, @NotNull @NotNull IGuiOverlay overlay) Registers an overlay that renders above all others.- Parameters:
id
- A unique resource id for this overlayoverlay
- The overlay
-
register
private void register(@NotNull @NotNull RegisterGuiOverlaysEvent.Ordering ordering, @Nullable @Nullable ResourceLocation other, @NotNull @NotNull ResourceLocation key, @NotNull @NotNull IGuiOverlay overlay)
-
the RL-explicit variant
instead; mod ID inference will be removed in a later update, alongside the move of registration events to the NeoForge main bus