Interface IRenderable<T>
- Type Parameters:
T- the type of context object used by the rendering logic
- All Known Implementing Classes:
BakedRenderable,SimpleRenderable
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Defines a standard interface for things that can be rendered.
-
Method Summary
Modifier and TypeMethodDescriptionvoidrender(PoseStack poseStack, MultiBufferSource bufferSource, Function<ResourceLocation, RenderType> renderTypeFunction, int lightmapCoord, int overlayCoord, float partialTicks, T renderValues) Draws the renderable by adding the geometry to the providedMultiBufferSourcedefault IRenderable<Unit>withValues(T renderValues) Wraps the current renderable along with its configuration value.
-
Method Details
-
render
void render(PoseStack poseStack, MultiBufferSource bufferSource, Function<ResourceLocation, RenderType> renderTypeFunction, int lightmapCoord, int overlayCoord, float partialTicks, T renderValues) Draws the renderable by adding the geometry to the providedMultiBufferSource- Parameters:
poseStack- the pose stackbufferSource- the target buffer source to dump the data intorenderTypeFunction- a function that provides a RenderType for the given texturelightmapCoord- the lightmap coordinates representing the current lighting conditions. SeeLightTextureoverlayCoord- the overlay coordinates representing the current overlay status. SeeOverlayTexturepartialTicks- the current time expressed in the fraction of a tick elapsed since the last client tick.renderValues- the context data used for rendering
-
withValues
Wraps the current renderable along with its configuration value. Useful for keeping a list of various renderables paired with their configuration values.- Parameters:
renderValues- the context data to be used for rendering- Returns:
- a renderable that accepts
Unit.INSTANCEas a configuration value, but uses the providedrenderValueinstead
-