Class BaseRenderState
java.lang.Object
net.neoforged.neoforge.client.renderstate.BaseRenderState
- All Implemented Interfaces:
IRenderStateExtension
Extension class for RenderState objects (ie
EntityRenderState
).
Allows modders to add arbitrary data onto render states for use in custom rendering.-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> T
getRenderData
(net.minecraft.util.context.ContextKey<T> key) Gets the object associated with the given key.void
<T> void
setRenderData
(net.minecraft.util.context.ContextKey<T> key, T data) Sets the object associated with the given key.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.neoforge.client.extensions.IRenderStateExtension
getRenderDataOrDefault, getRenderDataOrThrow
-
Field Details
-
extensions
-
-
Constructor Details
-
BaseRenderState
public BaseRenderState()
-
-
Method Details
-
getRenderData
@Nullable public <T> T getRenderData(net.minecraft.util.context.ContextKey<T> key) Description copied from interface:IRenderStateExtension
Gets the object associated with the given key.- Specified by:
getRenderData
in interfaceIRenderStateExtension
- Type Parameters:
T
- Type of render data- Parameters:
key
- Static key reference object- Returns:
- The object associated with the key or null if the key is not present.
-
setRenderData
public <T> void setRenderData(net.minecraft.util.context.ContextKey<T> key, @Nullable T data) Description copied from interface:IRenderStateExtension
Sets the object associated with the given key. Key should be stored statically for later retrieval of the object.- Specified by:
setRenderData
in interfaceIRenderStateExtension
- Type Parameters:
T
- Type of render data- Parameters:
key
- Static key reference objectdata
- Object to store for custom rendering
-
resetRenderData
@Internal public void resetRenderData()
-