Interface IRenderable<T>
- Type Parameters:
T
- The type of context object used by the rendering logic
- All Known Implementing Classes:
BakedModelRenderable
,CompositeRenderable
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A standard interface for things that can be rendered to a
MultiBufferSource
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
render
(PoseStack poseStack, MultiBufferSource bufferSource, ITextureRenderTypeLookup textureRenderTypeLookup, int lightmap, int overlay, float partialTick, T context) Draws the renderable by adding the geometry to the providedMultiBufferSource
default IRenderable
<Unit> withContext
(T context) Wraps the current renderable along with a context.
-
Method Details
-
render
void render(PoseStack poseStack, MultiBufferSource bufferSource, ITextureRenderTypeLookup textureRenderTypeLookup, int lightmap, int overlay, float partialTick, T context) Draws the renderable by adding the geometry to the providedMultiBufferSource
- Parameters:
poseStack
- The pose stackbufferSource
- The buffer source where the vertex data should be outputtextureRenderTypeLookup
- A function that provides a RenderType for the given texturelightmap
- The lightmap coordinates representing the current lighting conditions. SeeLightTexture
overlay
- The overlay coordinates representing the current overlay status. SeeOverlayTexture
partialTick
- The current time expressed in the fraction of a tick elapsed since the last client tickcontext
- The context used for rendering
-
withContext
Wraps the current renderable along with a context. Useful for keeping a list of various renderables paired with their contexts.- Parameters:
context
- The context used for rendering- Returns:
- A renderable that accepts
Unit.INSTANCE
as context, but uses the providedcontext
instead
-