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.

@FunctionalInterface public interface IRenderable<T>
A standard interface for things that can be rendered to a MultiBufferSource.
  • 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 provided MultiBufferSource
      Parameters:
      poseStack - The pose stack
      bufferSource - The buffer source where the vertex data should be output
      textureRenderTypeLookup - A function that provides a RenderType for the given texture
      lightmap - The lightmap coordinates representing the current lighting conditions. See LightTexture
      overlay - The overlay coordinates representing the current overlay status. See OverlayTexture
      partialTick - The current time expressed in the fraction of a tick elapsed since the last client tick
      context - The context used for rendering
    • withContext

      default IRenderable<Unit> withContext(T context)
      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 provided context instead