Interface QueuePlayer


  • public interface QueuePlayer
    • Method Detail

      • getUniqueId

        java.util.UUID getUniqueId()
        Returns the player's UUID
        Returns:
        the player's UUID
      • getQueueServer

        QueueServer getQueueServer()
        Gets the server or group this player is queued for
        Returns:
        The QueueServer this player is queued for
      • getPosition

        default int getPosition()
        Gets the player's position in the queue
        Returns:
        The player's position. 1 being 1st, 2 being 2nd, etc
      • getPlayer

        @Nullable
        AdaptedPlayer getPlayer()
        Get the player this represents. Can be null because the player could not be online
        Returns:
        The player if they are online, null otherwise
      • setPlayer

        void setPlayer​(AdaptedPlayer player)
        Sets the player that this represents. Will throw IllegalArgumentException if the player's uuid does not match the original.
        Parameters:
        player - The player to add
      • getPriority

        int getPriority()
        Gets the highest priority level the player has. In free ajQueue, no priority is 0 and priority is 1
        Returns:
        The priority level of this player for this server
      • hasPriority

        boolean hasPriority()
        Gets if this player has priority
      • getName

        java.lang.String getName()
        Gets the player's username
        Returns:
        the player's username
      • getTimeSinceOnline

        long getTimeSinceOnline()
        Returns the number of miliseconds since this player was online
        Returns:
        The number of miliseconds since this player was online
      • getMaxOfflineTime

        int getMaxOfflineTime()
        Gets the max number of seconds this player is allowed to be offline before getting removed from the queue.
        Returns:
        the max number of seconds this player can be offline before being removed from the queue
      • getInitialServer

        AdaptedServer getInitialServer()
        Gets the server that the player was in when they joined the queue
        Returns:
        the server that the player was in when they joined the queue
      • connect

        void connect​(@NotNull
                     @NotNull AdaptedServer server)
        Attempts a connection to the provided AdaptedServer, calling PreConnectEvent before AdaptedPlayer.connect(...)