Class HudElementRegistryImpl
java.lang.Object
net.fabricmc.fabric.impl.client.rendering.hud.HudElementRegistryImpl
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordAn element that wraps a vanilla element using a list, allowing for users to attach layers before or after it, replace it, or remove it. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Map<net.minecraft.resources.Identifier, HudElementRegistryImpl.RootLayer> A map containing vanilla layers. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddFirst(net.minecraft.resources.Identifier id, HudElement element) static voidaddLast(net.minecraft.resources.Identifier id, HudElement element) static voidattachElementAfter(net.minecraft.resources.Identifier afterThis, net.minecraft.resources.Identifier id, HudElement element) static voidattachElementBefore(net.minecraft.resources.Identifier beforeThis, net.minecraft.resources.Identifier id, HudElement element) getRoot(net.minecraft.resources.Identifier id) static voidremoveElement(net.minecraft.resources.Identifier identifier) static voidreplaceElement(net.minecraft.resources.Identifier identifier, Function<HudElement, HudElement> replacer)
-
Field Details
-
ROOT_ELEMENTS
@VisibleForTesting public static final Map<net.minecraft.resources.Identifier, HudElementRegistryImpl.RootLayer> ROOT_ELEMENTSA map containing vanilla layers. This map should not be modified. ModifyHudElementRegistryImpl.RootLayer.layers()instead.
-
-
Constructor Details
-
HudElementRegistryImpl
public HudElementRegistryImpl()
-
-
Method Details
-
getRoot
-
addFirst
-
addLast
-
attachElementBefore
public static void attachElementBefore(net.minecraft.resources.Identifier beforeThis, net.minecraft.resources.Identifier id, HudElement element) -
attachElementAfter
public static void attachElementAfter(net.minecraft.resources.Identifier afterThis, net.minecraft.resources.Identifier id, HudElement element) -
removeElement
public static void removeElement(net.minecraft.resources.Identifier identifier) -
replaceElement
public static void replaceElement(net.minecraft.resources.Identifier identifier, Function<HudElement, HudElement> replacer)
-