Class ServerPreConnectEvent.ServerResult
java.lang.Object
me.internalizable.numdrassl.api.event.server.ServerPreConnectEvent.ServerResult
- All Implemented Interfaces:
ResultedEvent.Result
- Enclosing class:
ServerPreConnectEvent
public static final class ServerPreConnectEvent.ServerResult
extends Object
implements ResultedEvent.Result
Result for a server pre-connect event.
-
Method Summary
Modifier and TypeMethodDescriptionallowed(RegisteredServer server) Allow the connection to the specified server.denied()Deny the connection.Deny the connection with a reason.Get the reason for denying the connection.Get the server to connect to.booleanCheck if this result allows the action to proceed.
-
Method Details
-
isAllowed
public boolean isAllowed()Description copied from interface:ResultedEvent.ResultCheck if this result allows the action to proceed.- Specified by:
isAllowedin interfaceResultedEvent.Result- Returns:
- true if allowed
-
getServer
Get the server to connect to.- Returns:
- the target server, or null if denied
-
getDenyReason
Get the reason for denying the connection.- Returns:
- the deny reason, or null if allowed
-
allowed
Allow the connection to the specified server.- Parameters:
server- the server to connect to- Returns:
- an allowed result
-
denied
Deny the connection.- Returns:
- a denied result
-
denied
Deny the connection with a reason.- Parameters:
reason- the reason to show the player- Returns:
- a denied result
-