Class ServerPreConnectEvent.ServerResult
java.lang.Object
com.velocitypowered.api.event.player.ServerPreConnectEvent.ServerResult
- All Implemented Interfaces:
ResultedEvent.Result
- Enclosing class:
- ServerPreConnectEvent
public static class ServerPreConnectEvent.ServerResult
extends Object
implements ResultedEvent.Result
Represents the result of the
ServerPreConnectEvent
.-
Method Summary
Modifier and TypeMethodDescriptionallowed
(RegisteredServer server) Allows the player to connect to the specified server.denied()
Returns a result that will prevent players from connecting to another server.boolean
Returns whether or not the event is allowed to proceed.toString()
-
Method Details
-
isAllowed
public boolean isAllowed()Description copied from interface:ResultedEvent.Result
Returns whether or not the event is allowed to proceed. Plugins may choose to skip denied events, and the proxy will respect the result of this method.- Specified by:
isAllowed
in interfaceResultedEvent.Result
- Returns:
- whether or not the event is allowed to proceed
-
getServer
-
toString
-
denied
Returns a result that will prevent players from connecting to another server. If this result is used, thenConnectionRequestBuilder.connect()
's result will have the statusConnectionRequestBuilder.Status.CONNECTION_CANCELLED
.- Returns:
- a result to deny conneections
-
allowed
Allows the player to connect to the specified server.- Parameters:
server
- the new server to connect to- Returns:
- a result to allow the player to connect to the specified server
-