API Reference
This page is a compact map of the current PulseLib public API. Classes marked internal in source are omitted unless they explain a public workflow.
Source links resolve against this checkout's Common/Fabric/NeoForge layout. For full signatures and contracts, generate each module's Javadoc with the documentation tasks.
Animatables and controllers
PAnimatable<T>andPItemAnimatable<T>define animatable objects.PAnimationManager<T>owns regular and graph controller factories, live controllers, and the bound model.PAnimationController<T>plays aPRawAnimationorPAnimationGraph, exposes graph parameters, controls timing, and owns persistent Molang state.InstanceAnimationManager<T>,SingletonAnimationManager<T>, andAnimManagerKeyprovide per-instance and keyed state.ControllerStateisPLAY,PAUSE, orSTOP.
Animation data and graphs
PRawAnimationis a builder for staged playback sequences;PAnimationTypeselects once, hold, or cycle behavior.PAnimationGraph,PAnimationState,PAnimationTransition,PCondition, andPAnimationGraphRuntimeimplement graph states, blend spaces, overlays, transitions, and runtime state.PAnimationParametersstores graph numeric/boolean inputs and one-use triggers.PInterruptionPolicyis used by graph transitions;PTransitionInterruptionPolicyis used by player-animation activation crossfades.PAnimation,PBoneAnimation,PAnimationTrack<T>, andPKeyframe<T>represent parsed animation data.PAnimationChannelType<T>is the generic channel contract.PAnimationChannelsupplies vector and quaternion implementations; PulseLib registers position, rotation, and scale channel types.PInterpolationandPInterpolationTypecontrol keyframe interpolation.PBlendModeandPPoseBlendModecontrol pose blending.PPose,PModelPose, andPAnimationPoseResolverevaluate local and model-space poses.PRootMotionRuntimeandPRootMotionDeltaextract incremental animation-space displacement data. Extraction does not change entity position, deltaMovement, hitboxes, collisions, or server state. PulseLib's ROOT rendering is visual only; applying the data to gameplay movement is the consuming mod's responsibility. See Visual Root Motion.PAnimationEvent,PAnimationEventType, andPAnimationEventDispatcherprovide typed sound, particle, camera-shake, callback, and parameter events. See Animation events for side policies and delivery intervals.
Models and loaders
PModelDataidentifies canonical models throughblock,item,entity,entityLayer, anddirectfactories.PModelResourceowns material texture references.PModel,PBone, andPMeshare raw data.PBakedModel,PBakedBone, andPBakedMeshare the baked runtime representation.PMeshRenderContextcarries mesh material and deformation overrides for queued and immediate rendering.PMeshRenderResolversupplies per-mesh resolution for direct model drawing; built-in renderers also expose bone/mesh resolver hooks.PModelCachemanages loaders, resource reloads, baking, and cache cleanup.PModelLoaderresolves canonical IDs, andPLoadedModelcarries the selected physical source through loader-specific processing.- glTF classes are in
data.gltf:PGltfModelLoader,PGltfModelParser, andPGltfAnimationEventSidecarParser. - Gecko and Molang classes are in
data.gecko:PGeckoModelLoader,PGeckoModelParser,PGeckoAnimationEventParser, andMolangParser. PAnimationSidecarParserhandles the shared event and visibility sidecar format used by the built-in loaders.
Rendering, textures, and attachments
PRenderer<T>,PBlockRenderer<T>,PItemRenderer<T>,PEntityRenderer<T>, andPEntityRenderLayer<T>are renderer entry points.PRenderTypesprovides compatible triangle render types;PRenderQueuebatches their submissions.PRenderContextsisolates GUI/offscreen entity submissions and identifies world/first-person passes.PRenderStagesHandlerowns normal world flush and OIT timing on both loaders.PGeometryDatais immutable static triangle data, andPInstanceHeadercarries a transform, color, lighting, overlay, and optional GPU-deformer offsets for one queued instance.PDrawCommand,PDrawGroup, andPRenderPlanare backend plan data; normal mods should submit throughPRenderQueuerather than construct them.PGpuDeformerBuffersstreams supported deformer stacks to the renderer. Its lifecycle is managed by PulseLib.PModelResource,PTextureReference,PResourceCache, andRuntimeLoadermanage registered model resources, model-local texture resolution, and the runtime texture atlas.- Attachments are centered on
PLivingAttachmentDefinition,PLivingAttachments,PAttachmentBinding, andPAttachmentAnchor.
Player animations
PPlayerAnimationDefinitionconfigures bindings, masks, blend modes, weights, activation crossfades, cycle synchronization, controllers, Molang queries, animation-owned mesh deformers throughBuilder.deform(...), and first-person held-item behavior throughBuilder.itemRenderPolicy(...)andBuilder.itemVisibility(...).PPlayerAnimations,PPlayerAnimationHandle, andPPlayerAnimationInstanceexpose runtime registration and per-player state.PPlayerPart,PPlayerAnimationMask,PPlayerAnimationBlendMode, andPPlayerAnimationWeightdefine how a player pose is applied.PPlayerAnimationFrame, obtained withPPlayerAnimationInstance.sampleFrame(partialTick), exposes full model-space sockets throughactionTransform, bind-root-relative transforms throughrootRelativeTransform, and current-root-relative transforms for an already rooted stack throughcurrentRootRelativeTransform/currentRootRelativeMatrix.modelMatrix/bindMatrixpreserve exact parent products, including shear that TRS snapshots cannot represent.cameraAnchorModelDeltasupplies camera-origin displacement and inherited orientation in the native visual reference frame. See Transform spaces and Animated camera.PPlayerAnimationAnchorandPPlayerAnimationAnchorsname semantic sockets such asRIGHT_ITEM,LEFT_ITEM, andFIRST_PERSON_CAMERA.PPlayerAnimatedAttachmentRendererreceives an already positioned stack throughPPlayerAnimatedAttachmentContext. Render local geometry; applying the socket transform to that stack again duplicates it.PPlayerFirstPersonSettingsenables first-person output and selectsPFirstPersonCameraMode.PFirstPersonPresentationsupplies the shared camera-relative VIEW frame for arms, items, anchors, and meshes.ANIMATEDfollows the full camera-anchor hierarchy;VANILLAkeeps the actual camera position/rotation while retaining that authored presentation frame.PPlayerAnimationDeformer,PPlayerAnimationDeformerValueSource, andPPlayerAnimationDeformerContextattach a deformer stack to a definition and sample channels from its player/controller context.
Mesh deformers
PMeshDeformer,PDeformerInstance,PDeformerStack, andPChannelReferencedefine and evaluate reusable deformations.- Built-in operations are
PBendDeformer,PHingeDeformer,PTwistDeformer,PStretchDeformer,PSquashDeformer,PTaperDeformer, andPWaveDeformer. PMeshDeformationandPDeformedMeshBuffersdrive deformed custom triangle meshes and optional subdivision.PPlayerMeshDeformersis the independent player-binding API.
Plugins and helpers
@PulsePlugin,IPulseClientPlugin,IPulseCommonPluginand specialized registrars are the extension API on both loaders; see Plugins for phases and physical sides.PLibHelper,PLibCodecs, andPLibDatabaseare common integration helpers.
Graph sampling and pose metadata
Runtime overlay methods on PAnimationGraphRuntime: overlaySpeed, setOverlaySpeed, restartOverlay, stopOverlay, each with state-name and state-index overloads. Graph sampling exposes sampleBasePose, samplePose, an interpolated layers overload, and a tickPrecise overload accepting a base snapshot sampler. See overlay control and RESTART snapshots for timing, errors and custom consumers.
PPose.copy() deeply copies TRS, channel masks, scalar values, visibility and dirty/valid flags. hasTranslation, hasRotation, hasScale, hasScalarChannel, hasVisibility, isVisible, visibility and scalarChannelCount expose the corresponding metadata. PPoseMixer.blend blends resolved poses; PPoseMixer.Transition(mixer, referencePose, initialLayer) supplies the actual reference/hierarchy for RESTART while preserving the existing constructor.
Nonidentity values written through the original mutable TRS getters still contribute to mixing. Use the PPoseWriter setters (or set / setAnimated) when declaring explicitly animated identity channels, so their presence can be distinguished from an absent channel.
PAnimationController.setGraphSnapshotContexts(provider) supplies fresh game-specific queries for tick-boundary capture. PAnimationRuntime.captureGraphBase also accepts a context provider for custom controller integrations. Persistent variable storage stays local to each controller.
Overlay definition/runtime speeds are signed. Activation/restart uses the clip end for negative speed and the beginning for positive speed; zero pauses and retains the last direction. A speed change preserves the cursor; NaN/Infinity are rejected. Reverse completion, fade-out and event dispatch follow the zero endpoint. See runtime overlay control.