RenderPipeline

Represents the rendering pipeline for a specific model instance.

This class manages the hierarchy of RenderedBones, handles player visibility and packet bundling, and coordinates animation updates and inverse kinematics (IK) solving.

Since

1.15.2

Constructors

Link copied to clipboard
constructor(@NotNull parent: @NotNull ModelRenderer, @NotNull source: @NotNull RenderSource<*>, @NotNull bones: Array<@NotNull RenderedBone>)
Creates a new render pipeline for a model renderer and root bones.

Types

Link copied to clipboard
open inner class SpawnedPlayer
Represents a player for whom the model has been spawned.

Functions

Link copied to clipboard
open fun addGlobalRotModifier(@NotNull predicate: @NotNull BonePredicate, @NotNull mapper: @NotNull (Quaternionf) -> Quaternionf): Boolean
Adds a global rotation modifier to bones matching the given predicate.
Link copied to clipboard
open fun addLocalRotModifier(@NotNull predicate: @NotNull BonePredicate, @NotNull mapper: @NotNull (Quaternionf) -> Quaternionf): Boolean
Adds a local rotation modifier to bones matching the given predicate.
Link copied to clipboard
open fun addPositionModifier(@NotNull predicate: @NotNull BonePredicate, @NotNull mapper: @NotNull (Vector3f) -> Vector3f): Boolean
Adds a position modifier to bones matching the given predicate.
Link copied to clipboard
@NotNull
open fun allPlayer(): @NotNull Stream<PlayerChannelHandler>
Returns a stream of channel handlers for all players for whom the model is spawned.
Link copied to clipboard
@Nullable
open fun boneOf(@NotNull name: @NotNull BoneName): @Nullable RenderedBone
Retrieves a rendered bone by its name.
Link copied to clipboard
@NotNull
@Unmodifiable
open fun bones(): @NotNull @Unmodifiable Collection<RenderedBone>
Returns an unmodifiable collection of all rendered bones in this pipeline.
Link copied to clipboard
@Nullable
open fun channel(@NotNull uuid: @NotNull UUID): @Nullable PlayerChannelHandler
Retrieves the network channel handler for a specific player.
Link copied to clipboard
@NotNull
open fun createAnimationBundler(): @NotNull AnimationBundler
Creates an animation packet bundler based on configuration.
Link copied to clipboard
@NotNull
open fun createBundler(): @NotNull PacketBundler
Creates a packet bundler for this pipeline sized to hold all display entities.
Link copied to clipboard
open fun defaultPosition(@NotNull movement: @NotNull (Vector3f) -> Vector3f)
Sets the default position modifier for all bones in the pipeline.
Link copied to clipboard
open fun despawn()
Despawns the model for all viewing players, removes all hitboxes, and clears internal state.
Link copied to clipboard
open fun despawnPacketHandler(@NotNull despawnPacketHandler: @NotNull Consumer<PacketBundler>)
Adds a handler invoked when despawn packets are bundled.
Link copied to clipboard
@NotNull
open fun eventDispatcher(): @NotNull BoneEventDispatcher
Returns the bone event dispatcher used to register and trigger bone lifecycle events.
Link copied to clipboard
open fun extend(@NotNull eventHandler: @NotNull BoneEventHandler)
Link copied to clipboard
open fun <T> firstNotNull(@NotNull mapper: @NotNull (RenderedBone) -> T): @Nullable T
Finds the first non-null result of applying a mapping function across all flattened bones.
Link copied to clipboard
open fun forEach(@NotNull action: @NotNull Consumer<in RenderedBone>)
Performs the given action for each rendered bone in this pipeline.
Link copied to clipboard
open fun forEachAllPlayer(@NotNull consumer: @NotNull Consumer<PlayerChannelHandler>)
Performs the given action for each player channel handler for whom the model is spawned.
Link copied to clipboard
open fun forEachNonHidePlayer(@NotNull consumer: @NotNull Consumer<PlayerChannelHandler>)
Performs the given action for each player channel handler who has finished initial load and is not hidden.
Link copied to clipboard
open fun forEachViewedPlayer(@NotNull consumer: @NotNull Consumer<PlayerChannelHandler>)
Performs the given action for each player channel handler who passes the view filter.
Link copied to clipboard
open fun hide(@NotNull player: @NotNull PlatformPlayer): Boolean
Hides the model and its hitboxes from a specific player.
Link copied to clipboard
open fun hideFilter(@NotNull filter: @NotNull Predicate<PlatformPlayer>)
Adds a filter to determine if a player should be hidden from the model.
Link copied to clipboard
open fun hidePacketHandler(@NotNull hidePacketHandler: @NotNull Consumer<PacketBundler>)
Adds a handler invoked when hide packets are bundled for a player.
Link copied to clipboard
@NotNull
open fun hitboxes(): @NotNull Stream<HitBox>
Returns a stream of all hitboxes associated with bones in this pipeline.
Link copied to clipboard
open fun isHide(@NotNull player: @NotNull PlatformPlayer): Boolean
Checks if the model is hidden from a specific player.
Link copied to clipboard
open fun isSpawned(@NotNull uuid: @NotNull UUID): Boolean
Checks if the model is currently spawned for a specific player.
Link copied to clipboard
@NotNull
open fun iterator(): @NotNull Iterator<RenderedBone>
Returns an iterator over the rendered bones in this pipeline.
Link copied to clipboard
open fun matchAnimation(@NotNull mapper: @NotNull BiPredicate<RenderedBone, AnimationOverrideState>): Boolean
Applies an animation override evaluation to all bone hierarchies.
Link copied to clipboard
open fun matchTree(@NotNull predicate: @NotNull Predicate<RenderedBone>): Boolean
Checks if any bone in the flattened hierarchy matches the given predicate.
open fun matchTree(@NotNull predicate: @NotNull BonePredicate, @NotNull mapper: @NotNull BiPredicate<RenderedBone, BonePredicate>): Boolean
Applies a matching predicate function to bones matching the given bone predicate.
Link copied to clipboard
@NotNull
open fun name(): @NotNull String
Returns the name of the model.
Link copied to clipboard
@NotNull
open fun nonHidePlayer(): @NotNull Stream<PlayerChannelHandler>
Returns a stream of players who have finished initial load and are not hidden.
Link copied to clipboard
open fun playerCount(): Int
Returns the number of players for whom the model is currently spawned.
Link copied to clipboard
@ApiStatus.Internal
open fun remove(@NotNull player: @NotNull PlatformPlayer): Boolean
Removes the model for a player and sends despawn packets immediately.
Link copied to clipboard
open fun rotate(@NotNull rotation: @NotNull ModelRotation, @NotNull bundler: @NotNull PacketBundler): Boolean
Rotates the model to a new orientation and bundles transformation packets.
Link copied to clipboard
@Nullable
open fun runningAnimation(): @Nullable RunningAnimation
Retrieves the currently running animation across bones, if any.
Link copied to clipboard
open fun scale(@NotNull scale: @NotNull FloatSupplier)
Sets the scale supplier for all bones in the pipeline.
Link copied to clipboard
open fun send(@NotNull context: @NotNull KeyframeRuntimeContext, @NotNull bundler: @NotNull AnimationBundler)
Solves inverse kinematics (IK) and bundles the current bone transformations into the given bundler.
Link copied to clipboard
open fun show(@NotNull player: @NotNull PlatformPlayer): Boolean
Shows the model and its hitboxes to a specific player if previously hidden.
Link copied to clipboard
open fun showPacketHandler(@NotNull showPacketHandler: @NotNull Consumer<PacketBundler>)
Adds a handler invoked when show packets are bundled for a player.
Link copied to clipboard
@ApiStatus.Internal
open fun spawn(@NotNull player: @NotNull PlatformPlayer, @NotNull bundler: @NotNull PacketBundler, @NotNull consumer: @NotNull Consumer<RenderPipeline.SpawnedPlayer>): Boolean
Spawns the model for a player and bundles initial packets.
Link copied to clipboard
open fun spawnPacketHandler(@NotNull spawnPacketHandler: @NotNull Consumer<PacketBundler>)
Adds a handler invoked when spawn packets are bundled.
Link copied to clipboard
@NotNull
open fun spliterator(): @NotNull Spliterator<RenderedBone>
Returns a spliterator over the flattened rendered bones in this pipeline.
Link copied to clipboard
@NotNull
open fun stream(): @NotNull Stream<RenderedBone>
Returns a sequential Stream with the flattened bones as its source.
Link copied to clipboard
open fun tick(): Boolean

open fun tick(@NotNull context: @NotNull KeyframeRuntimeContext, @NotNull uuid: @NotNull UUID, @NotNull bundler: @NotNull AnimationBundler): Boolean
Ticks the model for a specific player, updating per-player animations, solving IK, and bundling transformations.
Link copied to clipboard
@NotNull
open fun viewedPlayer(): @NotNull Stream<PlayerChannelHandler>
Returns a stream of player channel handlers who pass the view filter (regardless of hidden status).
Link copied to clipboard
open fun viewFilter(@NotNull filter: @NotNull Predicate<PlatformPlayer>)
Adds a filter to restrict which players can view the model.