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