Record Class PlayerBodyPartData
java.lang.Object
java.lang.Record
net.timtaran.interactivemc.body.player.data.PlayerBodyPartData
- Record Components:
bodyPartId- ID of dynamic body partghostBodyPartId- ID of the ghost body parttriggerState- Current trigger stategrabData- Current grab state (nullif nothing is grabbed)
public record PlayerBodyPartData(UUID bodyPartId, UUID ghostBodyPartId, TriggerState triggerState, @Nullable PlayerBodyPartData.GrabData grabData)
extends Record
Record storing player body part data used by player physics systems.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordGrab interaction state. -
Constructor Summary
ConstructorsConstructorDescriptionPlayerBodyPartData(UUID bodyPartId, UUID ghostBodyPartId, TriggerState triggerState, @Nullable PlayerBodyPartData.GrabData grabData) Creates an instance of aPlayerBodyPartDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebodyPartIdrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theghostBodyPartIdrecord component.@Nullable PlayerBodyPartData.GrabDatagrabData()Returns the value of thegrabDatarecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.Returns the value of thetriggerStaterecord component.withGrabData(@Nullable PlayerBodyPartData.GrabData newGrabData) Returns a new instance ofPlayerBodyPartDatawith the updated grab data.withTriggerState(@Nullable TriggerState newTriggerState) Returns a new instance ofPlayerBodyPartDatawith the updated trigger state.
-
Constructor Details
-
PlayerBodyPartData
public PlayerBodyPartData(UUID bodyPartId, UUID ghostBodyPartId, TriggerState triggerState, @Nullable @Nullable PlayerBodyPartData.GrabData grabData) Creates an instance of aPlayerBodyPartDatarecord class.- Parameters:
bodyPartId- the value for thebodyPartIdrecord componentghostBodyPartId- the value for theghostBodyPartIdrecord componenttriggerState- the value for thetriggerStaterecord componentgrabData- the value for thegrabDatarecord component
-
-
Method Details
-
withTriggerState
Returns a new instance ofPlayerBodyPartDatawith the updated trigger state. -
withGrabData
Returns a new instance ofPlayerBodyPartDatawith the updated grab data. -
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). -
bodyPartId
Returns the value of thebodyPartIdrecord component.- Returns:
- the value of the
bodyPartIdrecord component
-
ghostBodyPartId
Returns the value of theghostBodyPartIdrecord component.- Returns:
- the value of the
ghostBodyPartIdrecord component
-
triggerState
Returns the value of thetriggerStaterecord component.- Returns:
- the value of the
triggerStaterecord component
-
grabData
Returns the value of thegrabDatarecord component.- Returns:
- the value of the
grabDatarecord component
-