Record Class TargetPosition
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.battles.attack.animation.transform.TargetPosition
- Record Components:
target- the contextual animation target to resolve fromoffset- the offset applied to the target's entity position
A resolved position used by attack animation transforms.
A target position is made up of a contextual AnimationTarget, such as the attack
user or target, plus a local offset from that target's entity position. This allows
animation data to refer to battle-relative positions without storing direct world
coordinates.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<TargetPosition> static final com.mojang.serialization.Codec<TargetPosition> -
Constructor Summary
ConstructorsConstructorDescriptionTargetPosition(AnimationTarget target, org.joml.Vector3f offset) Creates an instance of aTargetPositionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionorg.joml.Vector3fapply(ActiveBattleAnimation animation) Resolves this target position for the supplied active animation.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.org.joml.Vector3foffset()Returns the value of theoffsetrecord component.target()Returns the value of thetargetrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DIRECT_CODEC
-
CODEC
-
-
Constructor Details
-
Method Details
-
apply
Resolves this target position for the supplied active animation.- Parameters:
animation- the active battle animation- Returns:
- the resolved world position
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
target
Returns the value of thetargetrecord component.- Returns:
- the value of the
targetrecord component
-
offset
public org.joml.Vector3f offset()Returns the value of theoffsetrecord component.- Returns:
- the value of the
offsetrecord component
-