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 Details

    • isAllowed

      public boolean isAllowed()
      Description copied from interface: ResultedEvent.Result
      Check if this result allows the action to proceed.
      Specified by:
      isAllowed in interface ResultedEvent.Result
      Returns:
      true if allowed
    • getServer

      @Nullable public RegisteredServer getServer()
      Get the server to connect to.
      Returns:
      the target server, or null if denied
    • getDenyReason

      @Nullable public String getDenyReason()
      Get the reason for denying the connection.
      Returns:
      the deny reason, or null if allowed
    • allowed

      public static ServerPreConnectEvent.ServerResult allowed(@Nonnull RegisteredServer server)
      Allow the connection to the specified server.
      Parameters:
      server - the server to connect to
      Returns:
      an allowed result
    • denied

      public static ServerPreConnectEvent.ServerResult denied()
      Deny the connection.
      Returns:
      a denied result
    • denied

      public static ServerPreConnectEvent.ServerResult denied(@Nonnull String reason)
      Deny the connection with a reason.
      Parameters:
      reason - the reason to show the player
      Returns:
      a denied result