Interface RenderSource<T extends Tracker>

Type Parameters:
T - the type of tracker created by this source
All Known Subinterfaces:
RenderSource.Dummy, RenderSource.Entity
All Known Implementing Classes:
RenderSource.BaseDummy, RenderSource.BaseEntity, RenderSource.BasePlayer, RenderSource.ProfiledDummy, RenderSource.ProfiledEntity, RenderSource.ProfiledPlayer

public sealed interface RenderSource<T extends Tracker> permits RenderSource.Entity, RenderSource.Dummy
Represents a source for rendering models, providing necessary context such as location and entity data.

This interface serves as the entry point for creating Tracker instances, which manage the lifecycle of a rendered model. It supports both entity-based and location-based (dummy) rendering sources.

Since:
1.15.2
  • Method Details

    • of

      @Internal @NotNull static RenderSource.Dummy of(@NotNull @NotNull PlatformLocation location)
      Creates a dummy render source at the specified location.
      Parameters:
      location - the location where the model will be rendered
      Returns:
      a new dummy render source
      Since:
      1.15.2
    • of

      @Internal @NotNull static RenderSource.Dummy of(@NotNull @NotNull PlatformLocation location, @NotNull ModelProfile.Uncompleted profile)
      Creates a dummy render source at the specified location with a specific model profile.
      Parameters:
      location - the location where the model will be rendered
      profile - the uncompleted model profile to use
      Returns:
      a new profiled dummy render source
      Since:
      1.15.2
    • of

      @Internal @NotNull static RenderSource.Entity of(@NotNull BaseEntity entity, @NotNull ModelProfile.Uncompleted profile)
      Creates an entity render source for the given entity with a specific model profile.
      Parameters:
      entity - the entity to attach the model to
      profile - the uncompleted model profile to use
      Returns:
      a new entity render source
      Since:
      1.15.2
    • of

      @Internal @NotNull static RenderSource.Entity of(@NotNull BaseEntity entity)
      Creates an entity render source for the given entity.
      Parameters:
      entity - the entity to attach the model to
      Returns:
      a new entity render source
      Since:
      1.15.2
    • location

      @NotNull @NotNull PlatformLocation location()
      Returns the location of this render source.
      Returns:
      the location
      Since:
      1.15.2
    • create

      T create(@NotNull @NotNull RenderPipeline pipeline, @NotNull @NotNull TrackerModifier modifier, @NotNull @NotNull Consumer<T> preUpdateConsumer)
      Creates a new tracker for this render source.
      Parameters:
      pipeline - the render pipeline to use
      modifier - the tracker modifier
      preUpdateConsumer - a consumer to run before updates
      Returns:
      the created tracker
      Since:
      1.15.2
    • completeContext

      @NotNull @NotNull CompletableFuture<BoneRenderContext> completeContext()
      Asynchronously completes the bone render context for this source.

      This method may involve fetching skin data or other resources.

      Returns:
      a future completing with the bone render context
      Since:
      1.15.2
    • fallbackContext

      default BoneRenderContext fallbackContext()
      Returns a fallback bone render context.

      This context is used when the complete context cannot be resolved or is not yet available.

      Returns:
      the fallback bone render context
      Since:
      1.15.2