Record Class PlayerBodyPartData

java.lang.Object
java.lang.Record
net.timtaran.interactivemc.body.player.data.PlayerBodyPartData
Record Components:
bodyPartId - ID of dynamic body part
ghostBodyPartId - ID of the ghost body part
triggerState - Current trigger state
grabData - Current grab state (null if 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.
  • Constructor Details

    • PlayerBodyPartData

      public PlayerBodyPartData(UUID bodyPartId, UUID ghostBodyPartId, TriggerState triggerState, @Nullable @Nullable PlayerBodyPartData.GrabData grabData)
      Creates an instance of a PlayerBodyPartData record class.
      Parameters:
      bodyPartId - the value for the bodyPartId record component
      ghostBodyPartId - the value for the ghostBodyPartId record component
      triggerState - the value for the triggerState record component
      grabData - the value for the grabData record component
  • Method Details

    • withTriggerState

      public PlayerBodyPartData withTriggerState(@Nullable @Nullable TriggerState newTriggerState)
      Returns a new instance of PlayerBodyPartData with the updated trigger state.
    • withGrabData

      public PlayerBodyPartData withGrabData(@Nullable @Nullable PlayerBodyPartData.GrabData newGrabData)
      Returns a new instance of PlayerBodyPartData with the updated grab data.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • bodyPartId

      public UUID bodyPartId()
      Returns the value of the bodyPartId record component.
      Returns:
      the value of the bodyPartId record component
    • ghostBodyPartId

      public UUID ghostBodyPartId()
      Returns the value of the ghostBodyPartId record component.
      Returns:
      the value of the ghostBodyPartId record component
    • triggerState

      public TriggerState triggerState()
      Returns the value of the triggerState record component.
      Returns:
      the value of the triggerState record component
    • grabData

      @Nullable public @Nullable PlayerBodyPartData.GrabData grabData()
      Returns the value of the grabData record component.
      Returns:
      the value of the grabData record component