Class ServerPreConnectEvent
java.lang.Object
me.internalizable.numdrassl.api.event.server.ServerPreConnectEvent
- All Implemented Interfaces:
ResultedEvent<ServerPreConnectEvent.ServerResult>
public class ServerPreConnectEvent
extends Object
implements ResultedEvent<ServerPreConnectEvent.ServerResult>
Event fired before a player connects to a backend server.
This includes initial connections and server transfers.
Setting the result allows you to redirect the player to a different server or cancel the connection entirely.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classResult for a server pre-connect event.Nested classes/interfaces inherited from interface ResultedEvent
ResultedEvent.GenericResult, ResultedEvent.Result -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the server that was originally requested.Get the player being connected.Get the current result.voidSet the result.
-
Constructor Details
-
ServerPreConnectEvent
-
-
Method Details
-
getPlayer
-
getOriginalServer
Get the server that was originally requested.- Returns:
- the original target server
-
getResult
Description copied from interface:ResultedEventGet the current result.- Specified by:
getResultin interfaceResultedEvent<ServerPreConnectEvent.ServerResult>- Returns:
- the result
-
setResult
Description copied from interface:ResultedEventSet the result.- Specified by:
setResultin interfaceResultedEvent<ServerPreConnectEvent.ServerResult>- Parameters:
result- the new result
-