public final class ServerPreConnectEvent extends Object implements ResultedEvent<ServerPreConnectEvent.ServerResult>
Modifier and Type | Class and Description |
---|---|
static class |
ServerPreConnectEvent.ServerResult
Represents the result of the
ServerPreConnectEvent . |
ResultedEvent.ComponentResult, ResultedEvent.GenericResult, ResultedEvent.Result
Constructor and Description |
---|
ServerPreConnectEvent(Player player,
RegisteredServer originalServer)
Creates the ServerPreConnectEvent.
|
Modifier and Type | Method and Description |
---|---|
RegisteredServer |
getOriginalServer()
Returns the server that the player originally tried to connect to.
|
Player |
getPlayer()
Returns the player connecting to the server.
|
ServerPreConnectEvent.ServerResult |
getResult()
Returns the result associated with this event.
|
void |
setResult(ServerPreConnectEvent.ServerResult result)
Sets the result of this event.
|
String |
toString() |
public ServerPreConnectEvent(Player player, RegisteredServer originalServer)
player
- the player who is connecting to a serveroriginalServer
- the server the player was trying to connect topublic Player getPlayer()
public ServerPreConnectEvent.ServerResult getResult()
ResultedEvent
getResult
in interface ResultedEvent<ServerPreConnectEvent.ServerResult>
public void setResult(ServerPreConnectEvent.ServerResult result)
ResultedEvent
setResult
in interface ResultedEvent<ServerPreConnectEvent.ServerResult>
result
- the new resultpublic RegisteredServer getOriginalServer()
ServerPreConnectEvent.ServerResult
of this event. To get the server the
player is currently on when this event is fired, use Player.getCurrentServer()
.