Class BaseRenderState
java.lang.Object
net.neoforged.neoforge.client.renderstate.BaseRenderState
- All Implemented Interfaces:
IRenderStateExtension
- Direct Known Subclasses:
EntityRenderState,MapRenderState,MapRenderState.MapDecorationRenderState
Extension class for RenderState objects (ie
EntityRenderState).
Allows modders to add arbitrary data onto render states for use in custom rendering.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TgetRenderData(ContextKey<T> key) Gets the object associated with the given key.void<T> voidsetRenderData(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, waitMethods inherited from interface net.neoforged.neoforge.client.extensions.IRenderStateExtension
getRenderDataOrDefault, getRenderDataOrThrow
-
Field Details
-
extensions
-
-
Constructor Details
-
BaseRenderState
public BaseRenderState()
-
-
Method Details
-
getRenderData
Description copied from interface:IRenderStateExtensionGets the object associated with the given key.- Specified by:
getRenderDatain 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
Description copied from interface:IRenderStateExtensionSets the object associated with the given key. Key should be stored statically for later retrieval of the object.- Specified by:
setRenderDatain 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()
-