Record Class InventoryTransactionData.UseItemOnEntityTransactionData

java.lang.Object
java.lang.Record
net.raphimc.viabedrock.protocol.model.inventory.InventoryTransactionData.UseItemOnEntityTransactionData
All Implemented Interfaces:
InventoryTransactionData
Enclosing interface:
InventoryTransactionData

public static record InventoryTransactionData.UseItemOnEntityTransactionData(long entityRuntimeId, ItemUseOnActorActionType actionType, int hotbarSlot, BedrockItem itemInHand, Position3f playerPosition, Position3f clickPosition) extends Record implements InventoryTransactionData
  • Constructor Details

    • UseItemOnEntityTransactionData

      public UseItemOnEntityTransactionData(long entityRuntimeId, ItemUseOnActorActionType actionType, int hotbarSlot, BedrockItem itemInHand, Position3f playerPosition, Position3f clickPosition)
      Creates an instance of a UseItemOnEntityTransactionData record class.
      Parameters:
      entityRuntimeId - the value for the entityRuntimeId record component
      actionType - the value for the actionType record component
      hotbarSlot - the value for the hotbarSlot record component
      itemInHand - the value for the itemInHand record component
      playerPosition - the value for the playerPosition record component
      clickPosition - the value for the clickPosition record component
  • Method Details

    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • entityRuntimeId

      public long entityRuntimeId()
      Returns the value of the entityRuntimeId record component.
      Returns:
      the value of the entityRuntimeId record component
    • actionType

      public ItemUseOnActorActionType actionType()
      Returns the value of the actionType record component.
      Returns:
      the value of the actionType record component
    • hotbarSlot

      public int hotbarSlot()
      Returns the value of the hotbarSlot record component.
      Returns:
      the value of the hotbarSlot record component
    • itemInHand

      public BedrockItem itemInHand()
      Returns the value of the itemInHand record component.
      Returns:
      the value of the itemInHand record component
    • playerPosition

      public Position3f playerPosition()
      Returns the value of the playerPosition record component.
      Returns:
      the value of the playerPosition record component
    • clickPosition

      public Position3f clickPosition()
      Returns the value of the clickPosition record component.
      Returns:
      the value of the clickPosition record component