Record Class GUIItemListener

java.lang.Object
java.lang.Record
de.placeblock.betterinventories.gui.listener.GUIItemListener
Record Components:
gui - The GUI this listener belongs to
All Implemented Interfaces:
org.bukkit.event.Listener

public record GUIItemListener(GUI gui) extends Record implements org.bukkit.event.Listener
Listener for GUIs that handles item interactions
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of a GUIItemListener record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    dispatchRemove(org.bukkit.event.Cancellable event, GUISection section, Vector2d position)
    Dispatches a remove action
    final boolean
    Indicates whether some other object is "equal to" this one.
    gui()
    Returns the value of the gui record component.
    final int
    Returns a hash code value for this object.
    void
    onInventoryClick(org.bukkit.event.inventory.InventoryClickEvent event)
    Called by Bukkit when Player clicks an Inventory
    void
    onInventoryDrag(org.bukkit.event.inventory.InventoryDragEvent event)
    Called by Bukkit when Player drags an Inventory
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • GUIItemListener

      public GUIItemListener(GUI gui)
      Creates an instance of a GUIItemListener record class.
      Parameters:
      gui - the value for the gui record component
  • Method Details

    • onInventoryClick

      public void onInventoryClick(org.bukkit.event.inventory.InventoryClickEvent event)
      Called by Bukkit when Player clicks an Inventory
      Parameters:
      event - The Event
    • dispatchRemove

      public void dispatchRemove(org.bukkit.event.Cancellable event, GUISection section, Vector2d position)
      Dispatches a remove action
      Parameters:
      event - The event
      section - The section
      position - The position
    • onInventoryDrag

      public void onInventoryDrag(org.bukkit.event.inventory.InventoryDragEvent event)
      Called by Bukkit when Player drags an Inventory
      Parameters:
      event - The Event
    • 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.
    • gui

      public GUI gui()
      Returns the value of the gui record component.
      Returns:
      the value of the gui record component