Skip to main content

Overview

The RenderPipeline class represents the rendering pipeline for a specific model instance. It manages the hierarchy of rendered bones, handles player visibility and packet bundling, and coordinates animation updates and inverse kinematics (IK) solving.

Constructor

Creates a new render pipeline instance. Parameters:
  • parent - The parent model renderer
  • source - The source of the rendering (entity or location)
  • bones - The array of root bones

Core Properties

getParent

Returns the parent ModelRenderer that created this pipeline.

getSource

Returns the RenderSource providing location and context data.

getRotation

Returns the current rotation state of the model.

name

Returns the name of the parent model renderer.

Bone Management

bones

Returns an unmodifiable collection of all bones in the pipeline.

boneOf

Retrieves a specific bone by its name. Parameters:
  • name - The bone name to search for
Returns: The rendered bone, or null if not found

stream

Returns a sequential stream of all flattened bones.

hitboxes

Returns a stream of all hitboxes associated with the model. Example:

Animation & Updates

tick

Ticks the model, updating animations and inverse kinematics. Parameters:
  • bundler - The packet bundler for sending updates
  • uuid - (Optional) Player UUID for per-player animations
Returns: true if any updates occurred

runningAnimation

Retrieves the currently running animation, if any.

rotate

Rotates the model to a new orientation. Parameters:
  • rotation - The new rotation
  • bundler - The packet bundler to use
Returns: true if the rotation changed, false otherwise Example:

Bone Modifiers

addRotationModifier

Adds a rotation modifier to bones matching the predicate. Parameters:
  • predicate - The predicate to select bones
  • mapper - The rotation mapping function
Returns: true if any bones were modified

addPositionModifier

Adds a position modifier to bones matching the predicate. Parameters:
  • predicate - The predicate to select bones
  • mapper - The position mapping function
Returns: true if any bones were modified

defaultPosition

Sets the default position modifier for all bones.

scale

Scales the entire model. Example:

Player Visibility

isSpawned

Checks if the model is spawned for a specific player.

playerCount

Returns the number of players currently viewing the model.

allPlayer

Returns a stream of all players viewing the model.

viewedPlayer

Returns a stream of players who pass the view filter.

nonHidePlayer

Returns a stream of players who are not hidden and pass the view filter. Example:

Hide/Show

hide

Hides the model from a specific player. Returns: true if the player was successfully hidden

show

Shows the model to a specific player (if previously hidden). Returns: true if the player was successfully shown

isHide

Checks if the model is hidden from a specific player. Example:

Filters & Handlers

viewFilter

Adds a filter to restrict which players can view the model.

hideFilter

Adds a filter to determine if a player should be hidden from the model.

Packet Handlers

Adds handlers for various packet events. Example:

Packet Bundling

createBundler

Creates a packet bundler for this pipeline.

createParallelBundler

Creates a parallel packet bundler based on configuration.

channel

Retrieves the channel handler for a specific player. Example:

Tree Operations

matchTree

Applies operations to bones matching a predicate.

matchAnimation

Applies a mapper to bones matching an animation predicate.

firstNotNull

Finds the first non-null result of applying a mapper to all bones. Example:

Lifecycle

despawn

Despawns the model for all players and clears internal state. Example:

Event Handling

eventDispatcher

Returns the bone event dispatcher for this pipeline.

Iteration

The RenderPipeline implements Iterable<RenderedBone>, allowing direct iteration:

Complete Example

See Also