ModelRotator

Defines how a model's rotation is calculated and applied.

Rotators can modify the base rotation (e.g., only applying yaw, smoothing rotation) and can be chained together.

Since

1.15.2

Inheritors

Types

Link copied to clipboard
interface Builder
Builder interface for creating Getters from JSON.
Link copied to clipboard
interface BuiltInDeserializer : Function<JsonElement, ModelRotator>
Helper interface for built-in deserializers.
Link copied to clipboard
Registry and factory for rotators.
Link copied to clipboard
interface Getter
Functional interface for calculating rotation.
Link copied to clipboard
Implementation of a chained rotator.

Properties

Link copied to clipboard
@NotNull
val DEFAULT: @NotNull ModelRotator
Default rotator (applies rotation as-is).
Link copied to clipboard
The global deserializer instance for rotators.
Link copied to clipboard
@NotNull
val EMPTY: @NotNull ModelRotator
Empty rotator (returns zero rotation).
Link copied to clipboard
@NotNull
val PITCH: @NotNull ModelRotator
Pitch-only rotator.
Link copied to clipboard
@NotNull
val YAW: @NotNull ModelRotator
Yaw-only rotator.

Functions

Link copied to clipboard
open fun <V> andThen(after: (in R) -> out V): BiFunction<T, U, V>
Link copied to clipboard
@NotNull
open fun apply(@NotNull tracker: @NotNull Tracker): @NotNull ModelRotation
Applies the rotator to a tracker with default rotation.
@NotNull
abstract fun apply(@NotNull tracker: @NotNull Tracker, @NotNull rotation: @NotNull ModelRotation): @NotNull ModelRotation
Applies the rotator to a tracker with a base rotation.
Link copied to clipboard
@Nullable
abstract fun data(): @Nullable JsonElement
Returns the configuration data for this rotator.
Link copied to clipboard
@NotNull
open fun deserialize(@NotNull object: @NotNull JsonObject): @NotNull ModelRotator
Deserializes a rotator from a JSON object.
Link copied to clipboard
@NotNull
open fun lazy(mills: Long): @NotNull ModelRotator
Creates a lazy rotator that smooths rotation over time.
Link copied to clipboard
@NotNull
abstract fun name(): @NotNull String
Returns the name of this rotator type.
Link copied to clipboard
@NotNull
open fun root(): @NotNull ModelRotator
Returns the root rotator in the chain.
Link copied to clipboard
@NotNull
open fun serialize(): @NotNull JsonObject
Serializes this rotator to a JSON object.
Link copied to clipboard
@Nullable
abstract fun source(): @Nullable ModelRotator
Returns the source rotator if this is a chained rotator.
Link copied to clipboard
@NotNull
open fun then(@NotNull rotator: @NotNull ModelRotator): @NotNull ModelRotator
Chains this rotator with another one.