Record Class PlayerQuitEvent
java.lang.Object
java.lang.Record
net.flectone.pulse.model.event.player.PlayerQuitEvent
- Record Components:
cancelled- whether a listener suppressed the quit handlingplayer- the leaving player
- All Implemented Interfaces:
Event, PlayerEvent
public record PlayerQuitEvent(boolean cancelled, FPlayer player)
extends Record
implements PlayerEvent
Fired when a player leaves the server.
-
Nested Class Summary
Nested classes/interfaces inherited from interface Event
Event.Priority -
Constructor Summary
ConstructorsConstructorDescriptionPlayerQuitEvent(boolean cancelled, FPlayer player) Creates an instance of aPlayerQuitEventrecord class.PlayerQuitEvent(FPlayer player) 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.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.
-
Constructor Details
-
PlayerQuitEvent
Creates an event that has not been cancelled.- Parameters:
player- the leaving player
-
PlayerQuitEvent
-
-
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).
-
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
-