Class AjQueueSpigotAPI

java.lang.Object
us.ajg0702.queue.api.spigot.AjQueueSpigotAPI

public abstract class AjQueueSpigotAPI extends Object
An API that is usable from the spigot-side
  • Field Details

  • Constructor Details

    • AjQueueSpigotAPI

      public AjQueueSpigotAPI()
  • Method Details

    • getInstance

      public static AjQueueSpigotAPI getInstance()
      Gets the instance of the ajQueue spigot API
      Returns:
      the ajQueue API
    • isInQueue

      public abstract Future<Boolean> isInQueue(UUID player)
    • addToQueue

      public abstract Future<Boolean> addToQueue(UUID player, String queueName)
      Adds a player to a queue (bypassing any permission checks that would prevent it)
      Parameters:
      player - The player to be added
      queueName - The server or group to add the player to
      Returns:
      True if adding was successful, false if not.
    • sudoQueue

      public abstract void sudoQueue(UUID player, String queueName)
      Emulate the player running the queue command for a certain server, including any permission checks
      Parameters:
      player - The player to sudo the command for
      queueName - The queue to send the player to
    • getQueueName

      public abstract Future<MessagedResponse<String>> getQueueName(UUID player)
      Gets the name of the queue that the player is in
      Parameters:
      player - the player
      Returns:
      the name of the queue that the player is in
    • getRawQueueName

      public abstract Future<MessagedResponse<String>> getRawQueueName(UUID player)
      Gets the raw name of the queue that the player is in (doesn't use server aliases)
      Parameters:
      player - the player
      Returns:
      the name of the queue that the player is in
    • getPosition

      public abstract Future<MessagedResponse<Integer>> getPosition(UUID player)
      Gets the position of the player in their queue
      Parameters:
      player - The player
      Returns:
      The position of the player in their queue
    • getTotalPositions

      public abstract Future<MessagedResponse<Integer>> getTotalPositions(UUID player)
      Gets the total number of players who are in queue with the player
      Parameters:
      player - The player
      Returns:
      The number of player in the queue that the player is in.
    • getPlayersInQueue

      public abstract Future<Integer> getPlayersInQueue(String queueName)
      Gets the number of players in a specific queue
      Parameters:
      queueName - The name of the queue
      Returns:
      The number of players in that queue.
    • getServerStatusString

      public abstract Future<String> getServerStatusString(String queueName)
      Gets the status string for the queue specified (e.g. full, restarting, etc) This is the display status, which is meant to be shown to players (and is pulled from the messages file)
      Parameters:
      queueName - the name of the queue
      Returns:
      The status string for the queue you specified.
    • getServerStatusString

      public abstract Future<String> getServerStatusString(String queueName, UUID player)
      Gets the status string for the queue specified (e.g. full, restarting, etc) This is the display status, which is meant to be shown to players (and is pulled from the messages file)
      Parameters:
      queueName - the name of the queue
      player - the player to check with
      Returns:
      The status string for the queue you specified.
    • getEstimatedTime

      public abstract Future<MessagedResponse<String>> getEstimatedTime(UUID player)
      Gets the estimated time until the player is sent to the server
      Parameters:
      player - The player to get
      Returns:
      The estimated time until the player is sent to the server