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.

@FunctionalInterface public interface IRenderable<T>
Defines a standard interface for things that can be rendered.
  • 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 provided MultiBufferSource
      Parameters:
      poseStack - the pose stack
      bufferSource - the target buffer source to dump the data into
      renderTypeFunction - a function that provides a RenderType for the given texture
      lightmapCoord - the lightmap coordinates representing the current lighting conditions. See LightTexture
      overlayCoord - the overlay coordinates representing the current overlay status. See OverlayTexture
      partialTicks - the current time expressed in the fraction of a tick elapsed since the last client tick.
      renderValues - the context data used for rendering
    • withValues

      default IRenderable<Unit> withValues(T renderValues)
      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.INSTANCE as a configuration value, but uses the provided renderValue instead