Class RenderLibHud
java.lang.Object
com.render.api.RenderLibHud
Entry point for HUD rendering callbacks.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidInstalls the HUD render hook used by the library.static voidClears all queued and visible HUD toasts.static booleanisRegistered(net.minecraft.resources.Identifier id) Returns whether a retained HUD widget is registered for the supplied id.static voidopenPlacementScreen(String modId) static voidopenPlacementScreen(net.minecraft.resources.Identifier modId) static RenderRegistrationregister(HudRenderer renderer) Registers a HUD renderer that is invoked every frame.static RenderRegistrationregister(ManagedHudLayout layout) static RenderRegistrationDeprecated.static ToastHandleshowToast(ToastComponent toast) Shows a managed HUD toast.static voidunregister(String modId) static voidunregister(net.minecraft.resources.Identifier id) Removes a retained HUD widget registration if present.
-
Method Details
-
bootstrap
public static void bootstrap()Installs the HUD render hook used by the library.Call this once during client initialization before registering HUD renderers.
-
register
Registers a HUD renderer that is invoked every frame.- Parameters:
renderer- callback that draws into the HUD canvas- Returns:
- a handle that unregisters the renderer when closed
-
register
-
register
@Deprecated(forRemoval=false, since="1.1.0") public static RenderRegistration register(net.minecraft.resources.Identifier id, HudWidget widget) Deprecated.Registers a retained HUD widget under the supplied id.- Parameters:
id- unique widget identifierwidget- widget to render- Returns:
- a handle that unregisters the widget when closed
-
isRegistered
public static boolean isRegistered(net.minecraft.resources.Identifier id) Returns whether a retained HUD widget is registered for the supplied id.- Parameters:
id- widget identifier- Returns:
truewhen the widget is registered
-
unregister
public static void unregister(net.minecraft.resources.Identifier id) Removes a retained HUD widget registration if present.- Parameters:
id- widget identifier
-
unregister
-
openPlacementScreen
-
openPlacementScreen
public static void openPlacementScreen(net.minecraft.resources.Identifier modId) -
showToast
Shows a managed HUD toast. The library owns stacking, expiry, and cleanup.- Parameters:
toast- toast to display- Returns:
- handle used to dismiss or inspect the toast
-
clearToasts
public static void clearToasts()Clears all queued and visible HUD toasts.
-