Record Class PlayerLoadEvent
java.lang.Object
java.lang.Record
net.flectone.pulse.model.event.player.PlayerLoadEvent
- Record Components:
cancelled- whether a listener suppressed the load handlingplayer- the loaded playerreload- whether this happened during a plugin reload rather than a fresh join
- All Implemented Interfaces:
Event, PlayerEvent
public record PlayerLoadEvent(boolean cancelled, FPlayer player, boolean reload)
extends Record
implements PlayerEvent
Fired once a player's stored data has been read and they are ready to be messaged.
-
Nested Class Summary
Nested classes/interfaces inherited from interface Event
Event.Priority -
Constructor Summary
ConstructorsConstructorDescriptionPlayerLoadEvent(boolean cancelled, FPlayer player, boolean reload) Creates an instance of aPlayerLoadEventrecord class.PlayerLoadEvent(FPlayer player) Creates an event for a fresh join rather than a reload.PlayerLoadEvent(FPlayer player, boolean reload) Creates an event that has not been cancelled. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecancelledrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.player()Returns the value of theplayerrecord component.booleanreload()Returns the value of thereloadrecord component.final StringtoString()Returns a string representation of this record class.withCancelled(boolean cancelled) Returns a copy of this event with the cancelled flag set.withPlayer(FPlayer player) Returns a copy of this event for a different player.withReload(boolean reload)
-
Constructor Details
-
PlayerLoadEvent
Creates an event that has not been cancelled.- Parameters:
player- the loaded playerreload- whether this happened during a reload
-
PlayerLoadEvent
Creates an event for a fresh join rather than a reload.- Parameters:
player- the loaded player
-
PlayerLoadEvent
-
-
Method Details
-
withCancelled
Description copied from interface:EventReturns a copy of this event with the cancelled flag set.- Specified by:
withCancelledin interfaceEvent- Parameters:
cancelled- the new cancelled state- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withPlayer
Description copied from interface:PlayerEventReturns a copy of this event for a different player.- Specified by:
withPlayerin interfacePlayerEvent- Parameters:
player- the new player- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withReload
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
cancelled
-
player
Returns the value of theplayerrecord component.- Specified by:
playerin interfacePlayerEvent- Returns:
- the value of the
playerrecord component
-
reload
-