Class PreLoginEvent
- java.lang.Object
-
- com.velocitypowered.api.event.connection.PreLoginEvent
-
- All Implemented Interfaces:
ResultedEvent<PreLoginEvent.PreLoginComponentResult>
public final class PreLoginEvent extends Object implements ResultedEvent<PreLoginEvent.PreLoginComponentResult>
This event is fired when a player has initiated a connection with the proxy but before the proxy authenticates the player with Mojang or before the player's proxy connection is fully established (for offline mode).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPreLoginEvent.PreLoginComponentResultRepresents an "allowed/allowed with forced online\offline mode/denied" result with a reason allowed for denial.-
Nested classes/interfaces inherited from interface com.velocitypowered.api.event.ResultedEvent
ResultedEvent.ComponentResult, ResultedEvent.GenericResult, ResultedEvent.Result
-
-
Constructor Summary
Constructors Constructor Description PreLoginEvent(InboundConnection connection, String username)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InboundConnectiongetConnection()PreLoginEvent.PreLoginComponentResultgetResult()Returns the result associated with this event.StringgetUsername()voidsetResult(@NonNull PreLoginEvent.PreLoginComponentResult result)Sets the result of this event.StringtoString()
-
-
-
Constructor Detail
-
PreLoginEvent
public PreLoginEvent(InboundConnection connection, String username)
Creates a new instance.- Parameters:
connection- the connection logging into the proxyusername- the player's username
-
-
Method Detail
-
getConnection
public InboundConnection getConnection()
-
getUsername
public String getUsername()
-
getResult
public PreLoginEvent.PreLoginComponentResult getResult()
Description copied from interface:ResultedEventReturns the result associated with this event.- Specified by:
getResultin interfaceResultedEvent<PreLoginEvent.PreLoginComponentResult>- Returns:
- the result of this event
-
setResult
public void setResult(@NonNull PreLoginEvent.PreLoginComponentResult result)
Description copied from interface:ResultedEventSets the result of this event. The result must be non-null.- Specified by:
setResultin interfaceResultedEvent<PreLoginEvent.PreLoginComponentResult>- Parameters:
result- the new result
-
-