Record Class PlayerBodyPartData.GrabData
java.lang.Object
java.lang.Record
net.timtaran.interactivemc.body.player.data.PlayerBodyPartData.GrabData
- Record Components:
grabbedBodyId- ID of grabbed bodyconstraintId- ID of attachment constraint (nullif not attached)retracting- Whether grabbed body is being pulled toward the body part
- Enclosing class:
PlayerBodyPartData
public static record PlayerBodyPartData.GrabData(@NotNull UUID grabbedBodyId, @Nullable UUID constraintId, boolean retracting)
extends Record
Grab interaction state.
Constraint states:
constraintId == null— body is freely grabbed/pulledconstraintId != null— body is attached using a constraint
Retraction states:
retracting == false— grabbed body remains at current distanceretracting == true— grabbed body is pulled toward the body part every tick
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable UUIDReturns the value of theconstraintIdrecord component.final booleanIndicates whether some other object is "equal to" this one.@NotNull UUIDReturns the value of thegrabbedBodyIdrecord component.final inthashCode()Returns a hash code value for this object.booleanbooleanReturns the value of theretractingrecord component.final StringtoString()Returns a string representation of this record class.withRetracting(boolean newRetracting)
-
Constructor Details
-
GrabData
public GrabData(@NotNull @NotNull UUID grabbedBodyId, @Nullable @Nullable UUID constraintId, boolean retracting) Creates an instance of aGrabDatarecord class.- Parameters:
grabbedBodyId- the value for thegrabbedBodyIdrecord componentconstraintId- the value for theconstraintIdrecord componentretracting- the value for theretractingrecord component
-
-
Method Details
-
isAttached
public boolean isAttached() -
withRetracting
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
grabbedBodyId
Returns the value of thegrabbedBodyIdrecord component.- Returns:
- the value of the
grabbedBodyIdrecord component
-
constraintId
Returns the value of theconstraintIdrecord component.- Returns:
- the value of the
constraintIdrecord component
-
retracting
public boolean retracting()Returns the value of theretractingrecord component.- Returns:
- the value of the
retractingrecord component
-