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<out Any>, @NotNull boneMap: @NotNull Map<BoneName, RenderedBone>)
Creates a new render pipeline.

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 addPositionModifier(@NotNull predicate: @NotNull BonePredicate, @NotNull mapper: @NotNull (Vector3f) -> Vector3f): Boolean
Adds a position modifier to matching bones.
Link copied to clipboard
open fun addRotationModifier(@NotNull predicate: @NotNull BonePredicate, @NotNull mapper: @NotNull (Quaternionf) -> Quaternionf): Boolean
Adds a rotation modifier to matching bones.
Link copied to clipboard
@NotNull
open fun allPlayer(): @NotNull Stream<Player>
Returns a stream of all players viewing this model.
Link copied to clipboard
@Nullable
open fun boneOf(@NotNull name: @NotNull BoneName): @Nullable RenderedBone
Retrieves a bone by its name.
Link copied to clipboard
@NotNull
@Unmodifiable
open fun bones(): @NotNull @Unmodifiable Collection<RenderedBone>
Returns a collection of all bones in this pipeline.
Link copied to clipboard
@Nullable
open fun channel(@NotNull uuid: @NotNull UUID): @Nullable PlayerChannelHandler
Retrieves the channel handler for a specific player.
Link copied to clipboard
@NotNull
open fun createBundler(): @NotNull PacketBundler
Creates a packet bundler for this pipeline.
Link copied to clipboard
@NotNull
open fun createLazyBundler(): @NotNull PacketBundler
Creates a lazy packet bundler.
Link copied to clipboard
@NotNull
open fun createParallelBundler(): @NotNull PacketBundler
Creates a parallel packet bundler based on configuration.
Link copied to clipboard
open fun defaultPosition(@NotNull movement: @NotNull (Vector3f) -> Vector3f)
Sets the default position modifier for all bones.
Link copied to clipboard
open fun despawn()
Despawns the model for all players and clears internal state.
Link copied to clipboard
open fun despawnPacketHandler(@NotNull despawnPacketHandler: @NotNull Consumer<PacketBundler>)
Adds a handler for despawn packets.
Link copied to clipboard
@NotNull
open fun eventDispatcher(): @NotNull BoneEventDispatcher
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 mapper to all bones.
Link copied to clipboard
open fun hide(@NotNull player: @NotNull Player): Boolean
Hides the model from a specific player.
Link copied to clipboard
open fun hideFilter(@NotNull filter: @NotNull Predicate<Player>)
Adds a filter to determine if a player should be hidden from the model.
Link copied to clipboard
open fun hidePacketHandler(@NotNull despawnPacketHandler: @NotNull Consumer<PacketBundler>)
Adds a handler for hide packets.
Link copied to clipboard
@NotNull
open fun hitboxes(): @NotNull Stream<HitBox>
Returns a stream of all hitboxes associated with this model.
Link copied to clipboard
open fun isHide(@NotNull player: @NotNull Player): 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 spawned for a specific player.
Link copied to clipboard
open fun iterateTree(@NotNull consumer: @NotNull Consumer<RenderedBone>)
Iterates over all bones in the tree.
Link copied to clipboard
open fun matchTree(@NotNull predicate: @NotNull Predicate<RenderedBone>): Boolean
Checks if any bones match a predicate.
open fun matchTree(@NotNull predicate: @NotNull AnimationPredicate, mapper: BiPredicate<RenderedBone, AnimationPredicate>): Boolean
Applies a mapper to bones matching an animation predicate.
open fun matchTree(@NotNull predicate: @NotNull BonePredicate, mapper: BiPredicate<RenderedBone, BonePredicate>): Boolean
Applies a mapper to bones matching a 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<Player>
Returns a stream of players who are not hidden and pass the view filter.
Link copied to clipboard
open fun playerCount(): Int
Returns the number of players currently viewing this model.
Link copied to clipboard
@ApiStatus.Internal
open fun remove(@NotNull player: @NotNull Player): Boolean
Removes the model for a player.
Link copied to clipboard
open fun rotate(@NotNull rotation: @NotNull ModelRotation, @NotNull bundler: @NotNull PacketBundler): Boolean
Rotates the model to a new orientation.
Link copied to clipboard
@Nullable
open fun runningAnimation(): @Nullable RunningAnimation
Retrieves the currently running animation, if any.
Link copied to clipboard
open fun scale(@NotNull scale: @NotNull FloatSupplier)
Scales the model.
Link copied to clipboard
open fun show(@NotNull player: @NotNull Player): Boolean
Shows the model to a specific player (if previously hidden).
Link copied to clipboard
open fun showPacketHandler(@NotNull despawnPacketHandler: @NotNull Consumer<PacketBundler>)
Adds a handler for show packets.
Link copied to clipboard
@ApiStatus.Internal
open fun spawn(@NotNull player: @NotNull Player, @NotNull bundler: @NotNull PacketBundler, @NotNull consumer: @NotNull Consumer<RenderPipeline.SpawnedPlayer>): Boolean
Spawns the model for a player.
Link copied to clipboard
open fun spawnPacketHandler(@NotNull spawnPacketHandler: @NotNull Consumer<PacketBundler>)
Adds a handler for spawn packets.
Link copied to clipboard
open fun tick(@NotNull bundler: @NotNull PacketBundler): Boolean
Ticks the model, updating animations and IK.
open fun tick(@NotNull uuid: @NotNull UUID, @NotNull bundler: @NotNull PacketBundler): Boolean
Ticks the model for a specific player (e.g., for per-player animations).
Link copied to clipboard
@NotNull
open fun viewedPlayer(): @NotNull Stream<Player>
Returns a stream of players who pass the view filter (regardless of hidden status).
Link copied to clipboard
open fun viewFilter(@NotNull filter: @NotNull Predicate<Player>)
Adds a filter to restrict which players can view the model.