Package dev.satyrn.xpeconomy.listeners
Record Class PlayerEventListener
java.lang.Object
java.lang.Record
dev.satyrn.xpeconomy.listeners.PlayerEventListener
- All Implemented Interfaces:
org.bukkit.event.Listener
public record PlayerEventListener(org.bukkit.plugin.Plugin plugin, AccountManager accountManager)
extends Record
implements org.bukkit.event.Listener
Listener class for player events.
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerEventListener
(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
onExpChange
(org.bukkit.event.player.PlayerExpChangeEvent e) Handles player experience value changes.void
onJoin
(org.bukkit.event.player.PlayerJoinEvent e) Handles player join events.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
-
PlayerEventListener
Initializes the player event listener.- Parameters:
accountManager
- The account manager instance.
-
-
Method Details
-
onJoin
public void onJoin(org.bukkit.event.player.PlayerJoinEvent e) Handles player join events.- Parameters:
e
- The event arguments.
-
onExpChange
public void onExpChange(org.bukkit.event.player.PlayerExpChangeEvent e) Handles player experience value changes.- 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
-