Record Class PlayerPreLoginEvent
java.lang.Object
java.lang.Record
net.flectone.pulse.model.event.player.PlayerPreLoginEvent
- Record Components:
cancelled- whether a listener vetoed the checkplayer- the connecting playerkickReason- the message shown when the player is refusedallowed- whether the player may join
- All Implemented Interfaces:
Event, PlayerEvent
public record PlayerPreLoginEvent(boolean cancelled, FPlayer player, net.kyori.adventure.text.Component kickReason, boolean allowed)
extends Record
implements PlayerEvent
Fired before a player is let in, while the connection can still be refused.
-
Nested Class Summary
Nested classes/interfaces inherited from interface Event
Event.Priority -
Constructor Summary
ConstructorsConstructorDescriptionPlayerPreLoginEvent(boolean cancelled, FPlayer player, net.kyori.adventure.text.Component kickReason, boolean allowed) Creates an instance of aPlayerPreLoginEventrecord class.PlayerPreLoginEvent(FPlayer player) Creates an event that allows the player in with no kick reason. -
Method Summary
Modifier and TypeMethodDescriptionbooleanallowed()Returns the value of theallowedrecord component.booleanReturns 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.net.kyori.adventure.text.ComponentReturns the value of thekickReasonrecord component.player()Returns the value of theplayerrecord component.final StringtoString()Returns a string representation of this record class.withAllowed(boolean allowed) withCancelled(boolean cancelled) Returns a copy of this event with the cancelled flag set.withKickReason(net.kyori.adventure.text.Component kickReason) withPlayer(FPlayer player) Returns a copy of this event for a different player.
-
Constructor Details
-
PlayerPreLoginEvent
Creates an event that allows the player in with no kick reason.- Parameters:
player- the connecting player
-
PlayerPreLoginEvent
public PlayerPreLoginEvent(boolean cancelled, FPlayer player, net.kyori.adventure.text.Component kickReason, boolean allowed) Creates an instance of aPlayerPreLoginEventrecord class.- Parameters:
cancelled- the value for thecancelledrecord componentplayer- the value for theplayerrecord componentkickReason- the value for thekickReasonrecord componentallowed- the value for theallowedrecord component
-
-
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).
-
withKickReason
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withAllowed
- 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
-
kickReason
public net.kyori.adventure.text.Component kickReason()Returns the value of thekickReasonrecord component.- Returns:
- the value of the
kickReasonrecord component
-
allowed
-