public static class ServerPreConnectEvent.ServerResult extends Object implements ResultedEvent.Result
ServerPreConnectEvent.| Modifier and Type | Method and Description |
|---|---|
static ServerPreConnectEvent.ServerResult |
allowed(RegisteredServer server)
Allows the player to connect to the specified server.
|
static ServerPreConnectEvent.ServerResult |
denied()
Returns a result that will prevent players from connecting to another server.
|
Optional<RegisteredServer> |
getServer() |
boolean |
isAllowed()
Returns whether or not the event is allowed to proceed.
|
String |
toString() |
public boolean isAllowed()
ResultedEvent.ResultisAllowed in interface ResultedEvent.Resultpublic Optional<RegisteredServer> getServer()
public static ServerPreConnectEvent.ServerResult denied()
ConnectionRequestBuilder.connect()'s result will have the status
ConnectionRequestBuilder.Status.CONNECTION_CANCELLED.public static ServerPreConnectEvent.ServerResult allowed(RegisteredServer server)
server - the new server to connect to