Record Class MachineInteractions.Click

java.lang.Object
java.lang.Record
fr.robie.machineengine.api.paper.MachineInteractions.Click
Enclosing class:
MachineInteractions

public static record MachineInteractions.Click(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.inventory.ItemStack item, @NotNull MachineInstance machine, @NotNull org.bukkit.block.Block block, @Nullable org.bukkit.block.BlockFace face, boolean sneaking) extends Record
A click on a machine's block with the main hand.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Click(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.inventory.ItemStack item, @NotNull MachineInstance machine, @NotNull org.bukkit.block.Block block, @Nullable org.bukkit.block.BlockFace face, boolean sneaking)
    Creates an instance of a Click record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull org.bukkit.block.Block
    Returns the value of the block record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    @Nullable org.bukkit.block.BlockFace
    Returns the value of the face record component.
    final int
    Returns a hash code value for this object.
    @NotNull org.bukkit.inventory.ItemStack
    Returns the value of the item record component.
    Returns the value of the machine record component.
    @NotNull org.bukkit.entity.Player
    Returns the value of the player record component.
    boolean
    Returns the value of the sneaking record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Click

      public Click(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull MachineInstance machine, @NotNull @NotNull org.bukkit.block.Block block, @Nullable @Nullable org.bukkit.block.BlockFace face, boolean sneaking)
      Creates an instance of a Click record class.
      Parameters:
      player - the value for the player record component
      item - the value for the item record component
      machine - the value for the machine record component
      block - the value for the block record component
      face - the value for the face record component
      sneaking - the value for the sneaking 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 org.bukkit.entity.Player player()
      Returns the value of the player record component.
      Returns:
      the value of the player record component
    • item

      @NotNull public @NotNull org.bukkit.inventory.ItemStack item()
      Returns the value of the item record component.
      Returns:
      the value of the item record component
    • machine

      @NotNull public @NotNull MachineInstance machine()
      Returns the value of the machine record component.
      Returns:
      the value of the machine record component
    • block

      @NotNull public @NotNull org.bukkit.block.Block block()
      Returns the value of the block record component.
      Returns:
      the value of the block record component
    • face

      @Nullable public @Nullable org.bukkit.block.BlockFace face()
      Returns the value of the face record component.
      Returns:
      the value of the face record component
    • sneaking

      public boolean sneaking()
      Returns the value of the sneaking record component.
      Returns:
      the value of the sneaking record component