Record Class InventoryEventListener

java.lang.Object
java.lang.Record
dev.satyrn.xpeconomy.listeners.InventoryEventListener
All Implemented Interfaces:
org.bukkit.event.Listener

public record InventoryEventListener(org.bukkit.plugin.Plugin plugin, AccountManager accountManager) extends Record implements org.bukkit.event.Listener
  • Constructor Summary

    Constructors
    Constructor
    Description
    InventoryEventListener(org.bukkit.plugin.Plugin plugin, AccountManager accountManager)
    Initializes the player event listener.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the accountManager record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    void
    onAnvilUsed(org.bukkit.event.inventory.InventoryClickEvent e)
    Handles the event that is called when a user takes or attempts to take an item from the anvil's third slot.
    void
    onEnchantItem(org.bukkit.event.enchantment.EnchantItemEvent e)
    Handles the event that is called when a user enchants an item.
    org.bukkit.plugin.Plugin
    Returns the value of the plugin record component.
    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

    • InventoryEventListener

      public InventoryEventListener(org.bukkit.plugin.Plugin plugin, AccountManager accountManager)
      Initializes the player event listener.
      Parameters:
      accountManager - The account manager instance.
  • Method Details

    • onEnchantItem

      public void onEnchantItem(org.bukkit.event.enchantment.EnchantItemEvent e)
      Handles the event that is called when a user enchants an item.
      Parameters:
      e - The event arguments.
    • onAnvilUsed

      public void onAnvilUsed(org.bukkit.event.inventory.InventoryClickEvent e)
      Handles the event that is called when a user takes or attempts to take an item from the anvil's third slot.
      Parameters:
      e - The event arguments.
    • 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.
    • plugin

      public org.bukkit.plugin.Plugin plugin()
      Returns the value of the plugin record component.
      Returns:
      the value of the plugin record component
    • accountManager

      public AccountManager accountManager()
      Returns the value of the accountManager record component.
      Returns:
      the value of the accountManager record component