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
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordA basic implementation ofRenderSource.Dummywith a location.static final recordA basic implementation ofRenderSource.Entitywrapping aBaseEntity.static final recordA basic implementation ofRenderSource.Entitywrapping aBasePlayer.static interfaceRepresents a render source at a fixed location, not attached to an entity.static interfaceRepresents a render source attached to an entity.static final recordA profiled implementation ofRenderSource.Dummywith a location and a model profile.static final recordA profiled implementation ofRenderSource.Entitywrapping aBaseEntityand a model profile.static final recordA profiled implementation ofRenderSource.Entitywrapping aBasePlayerand a model profile. -
Method Summary
Modifier and TypeMethodDescription@NotNull CompletableFuture<BoneRenderContext> Asynchronously completes the bone render context for this source.create(@NotNull RenderPipeline pipeline, @NotNull TrackerModifier modifier, @NotNull Consumer<T> preUpdateConsumer) Creates a new tracker for this render source.default BoneRenderContextReturns a fallback bone render context.@NotNull PlatformLocationlocation()Returns the location of this render source.static RenderSource.Entityof(BaseEntity entity) Creates an entity render source for the given entity.static RenderSource.Entityof(BaseEntity entity, ModelProfile.Uncompleted profile) Creates an entity render source for the given entity with a specific model profile.static RenderSource.Dummyof(@NotNull PlatformLocation location) Creates a dummy render source at the specified location.static RenderSource.Dummyof(@NotNull PlatformLocation location, ModelProfile.Uncompleted profile) Creates a dummy render source at the specified location with a specific model profile.
-
Method Details
-
of
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 renderedprofile- 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 toprofile- the uncompleted model profile to use- Returns:
- a new entity render source
- Since:
- 1.15.2
-
of
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
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 usemodifier- the tracker modifierpreUpdateConsumer- a consumer to run before updates- Returns:
- the created tracker
- Since:
- 1.15.2
-
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
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
-