Package dev.satyrn.xpeconomy.listeners
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
ConstructorDescriptionInventoryEventListener
(org.bukkit.plugin.Plugin plugin, AccountManager accountManager) Initializes the player event listener. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaccountManager
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
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
plugin()
Returns the value of theplugin
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
InventoryEventListener
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
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. -
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. -
equals
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 withObjects::equals(Object,Object)
. -
plugin
public org.bukkit.plugin.Plugin plugin()Returns the value of theplugin
record component.- Returns:
- the value of the
plugin
record component
-
accountManager
Returns the value of theaccountManager
record component.- Returns:
- the value of the
accountManager
record component
-