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 bones: Array<@NotNull 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 addGlobalRotModifier(@NotNull predicate: @NotNull BonePredicate, @NotNull mapper: @NotNull (Quaternionf) -> Quaternionf): Boolean
Adds a global rotation modifier to matching bones.
Link copied to clipboard
open fun addLocalRotModifier(@NotNull predicate: @NotNull BonePredicate, @NotNull mapper: @NotNull (Quaternionf) -> Quaternionf): Boolean
Adds a local rotation modifier to matching bones.
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
@NotNull
open fun allPlayer(): @NotNull Stream<PlayerChannelHandler>
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 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.
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 forEach(@NotNull action: @NotNull Consumer<in RenderedBone>)
Link copied to clipboard
open fun hide(@NotNull player: @NotNull PlatformPlayer): Boolean
Hides the model 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 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 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 spawned for a specific player.
Link copied to clipboard
@NotNull
open fun iterator(): @NotNull Iterator<RenderedBone>
Link copied to clipboard
open fun matchAnimation(@NotNull mapper: @NotNull BiPredicate<RenderedBone, AnimationOverrideState>): Boolean
Applies a mapper to bones matching an animation predicate.
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 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<PlayerChannelHandler>
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 PlatformPlayer): 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 PlatformPlayer): 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 PlatformPlayer, @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
@NotNull
open fun spliterator(): @NotNull Spliterator<RenderedBone>
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(@NotNull bundler: @NotNull AnimationBundler): Boolean
Ticks the model, updating animations and IK.
open fun tick(@NotNull uuid: @NotNull UUID, @NotNull bundler: @NotNull AnimationBundler): Boolean
Ticks the model for a specific player (e.g., for per-player animations).
Link copied to clipboard
@NotNull
open fun viewedPlayer(): @NotNull Stream<PlayerChannelHandler>
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<PlatformPlayer>)
Adds a filter to restrict which players can view the model.