Interface AdaptedServer

  • All Superinterfaces:
    Handle

    public interface AdaptedServer
    extends Handle
    • Method Detail

      • getServerInfo

        AdaptedServerInfo getServerInfo()
        Gets the ServerInfo for this server
        Returns:
        The AdaptedServerInfo for this server
      • getName

        java.lang.String getName()
        Gets the server's name
        Returns:
        the server's name
      • ping

        default java.util.concurrent.CompletableFuture<AdaptedServerPing> ping()
        Pings the server and gets info back
        Returns:
        A CompletableFuture with the ServerPing
      • canAccess

        boolean canAccess​(AdaptedPlayer player)
        If the player can access the server Uses bungeecord's restricted server feature Will always return true on other platforms
        Parameters:
        player - The player to check
        Returns:
        False if the server is restricted and the player does not have permission to join.
      • getOfflineTime

        int getOfflineTime()
        Gets the number of seconds this server has been offline
        Returns:
        The number of seconds this server has been offline
      • canJoinFull

        default boolean canJoinFull​(AdaptedPlayer player)
      • canJoinFull

        static boolean canJoinFull​(AdaptedPlayer player,
                                   java.lang.String serverName)
      • justWentOnline

        boolean justWentOnline()
      • isJoinable

        default boolean isJoinable​(AdaptedPlayer player)
      • isFull

        default boolean isFull()
      • isOnline

        default boolean isOnline()
        Gets if the last ping was successful (which almost always means the server is online)
        Returns:
        If the server is determined to be online or not
      • shouldWaitAfterOnline

        boolean shouldWaitAfterOnline()
      • getPlayerCount

        default int getPlayerCount()
        Gets the number of players currently online
        Returns:
        The number of players online
      • getMaxPlayers

        default int getMaxPlayers()
        Gets the maximum number of players that can join this server.
        Returns:
        The maximum number of players that can join this server
      • addPlayer

        default void addPlayer()
        Temporarily adds one player to the player count
      • isWhitelisted

        default boolean isWhitelisted()
        Checks if the spigot-side reports that the server is whitelisted
        Returns:
        True if the server is whitelisted
      • getWhitelistedPlayers

        default java.util.List<java.util.UUID> getWhitelistedPlayers()
        (if the server is whitelisted) returns the list of players that are whitelisted
        Returns:
        The list of players that are whitelisted