Record Class MachineAction.Click

java.lang.Object
java.lang.Record
fr.robie.machineengine.api.machine.MachineAction.Click
Record Components:
player - who clicked
index - the button's index (index:; the row of a MachineList), 0 by default
held - the stack on the cursor, or the stack shift-clicked for MachineAction.ClickKind.INSERT; null if none
Enclosing interface:
MachineAction

public static record MachineAction.Click(@NotNull UUID player, @NotNull MachineAction.ClickKind kind, int index, @Nullable ResourceStack held) extends Record
  • Constructor Details

    • Click

      public Click(@NotNull @NotNull UUID player, @NotNull @NotNull MachineAction.ClickKind kind, int index, @Nullable @Nullable ResourceStack held)
      Creates an instance of a Click record class.
      Parameters:
      player - the value for the player record component
      kind - the value for the kind record component
      index - the value for the index record component
      held - the value for the held 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 the compare method from their corresponding wrapper classes.
      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.
    • player

      @NotNull public @NotNull UUID player()
      Returns the value of the player record component.
      Returns:
      the value of the player record component
    • kind

      @NotNull public @NotNull MachineAction.ClickKind kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • index

      public int index()
      Returns the value of the index record component.
      Returns:
      the value of the index record component
    • held

      @Nullable public @Nullable ResourceStack held()
      Returns the value of the held record component.
      Returns:
      the value of the held record component