Class PreLoginEventImpl
- java.lang.Object
-
- com.velocitypowered.api.event.player.PreLoginEventImpl
-
- All Implemented Interfaces:
Event,PreLoginEvent,ResultedEvent<ResultedEvent.ComponentResult>
public final class PreLoginEventImpl extends Object implements PreLoginEvent
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/interfaces inherited from interface com.velocitypowered.api.event.ResultedEvent
ResultedEvent.ComponentResult, ResultedEvent.GenericResult, ResultedEvent.Result
-
-
Constructor Summary
Constructors Constructor Description PreLoginEventImpl(InboundConnection connection, String username, boolean onlineMode)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InboundConnectionconnection()booleanonlineMode()ResultedEvent.ComponentResultresult()Returns the result associated with this event.voidsetOnlineMode(boolean onlineMode)voidsetResult(@NonNull ResultedEvent.ComponentResult result)Sets the result of this event.StringtoString()Stringusername()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.velocitypowered.api.event.player.PreLoginEvent
allow, reject
-
-
-
-
Constructor Detail
-
PreLoginEventImpl
public PreLoginEventImpl(InboundConnection connection, String username, boolean onlineMode)
Creates a new instance.- Parameters:
connection- the connection logging into the proxyusername- the player's usernameonlineMode- whether or not the connection is online mode
-
-
Method Detail
-
connection
public InboundConnection connection()
- Specified by:
connectionin interfacePreLoginEvent
-
username
public String username()
- Specified by:
usernamein interfacePreLoginEvent
-
onlineMode
public boolean onlineMode()
- Specified by:
onlineModein interfacePreLoginEvent
-
setOnlineMode
public void setOnlineMode(boolean onlineMode)
- Specified by:
setOnlineModein interfacePreLoginEvent
-
result
public ResultedEvent.ComponentResult result()
Description copied from interface:ResultedEventReturns the result associated with this event.- Specified by:
resultin interfaceResultedEvent<ResultedEvent.ComponentResult>- Returns:
- the result of this event
-
setResult
public void setResult(@NonNull ResultedEvent.ComponentResult result)
Description copied from interface:ResultedEventSets the result of this event. The result must be non-null.- Specified by:
setResultin interfaceResultedEvent<ResultedEvent.ComponentResult>- Parameters:
result- the new result
-
-