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 class
PreLoginEvent.PreLoginComponentResult
Represents 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 InboundConnection
getConnection()
PreLoginEvent.PreLoginComponentResult
getResult()
Returns the result associated with this event.String
getUsername()
void
setResult(@NonNull PreLoginEvent.PreLoginComponentResult result)
Sets the result of this event.String
toString()
-
-
-
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:ResultedEvent
Returns the result associated with this event.- Specified by:
getResult
in interfaceResultedEvent<PreLoginEvent.PreLoginComponentResult>
- Returns:
- the result of this event
-
setResult
public void setResult(@NonNull PreLoginEvent.PreLoginComponentResult result)
Description copied from interface:ResultedEvent
Sets the result of this event. The result must be non-null.- Specified by:
setResult
in interfaceResultedEvent<PreLoginEvent.PreLoginComponentResult>
- Parameters:
result
- the new result
-
-