Package us.ajg0702.queue.api.spigot
Class AjQueueSpigotAPI
- java.lang.Object
-
- us.ajg0702.queue.api.spigot.AjQueueSpigotAPI
-
public abstract class AjQueueSpigotAPI extends java.lang.Object
An API that is usable from the spigot-side
-
-
Field Summary
Fields Modifier and Type Field Description static AjQueueSpigotAPI
INSTANCE
-
Constructor Summary
Constructors Constructor Description AjQueueSpigotAPI()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.util.concurrent.Future<java.lang.Boolean>
addToQueue(java.util.UUID player, java.lang.String queueName)
Adds a player to a queue (bypassing any permission checks that would prevent it)abstract java.util.concurrent.Future<MessagedResponse<java.lang.String>>
getEstimatedTime(java.util.UUID player)
Gets the estimated time until the player is sent to the serverstatic AjQueueSpigotAPI
getInstance()
Gets the instance of the ajQueue spigot APIabstract java.util.concurrent.Future<java.lang.Integer>
getPlayersInQueue(java.lang.String queueName)
Gets the number of players in a specific queueabstract java.util.concurrent.Future<MessagedResponse<java.lang.Integer>>
getPosition(java.util.UUID player)
Gets the position of the player in their queueabstract java.util.concurrent.Future<MessagedResponse<java.lang.String>>
getQueueName(java.util.UUID player)
Gets the name of the queue that the player is inabstract java.util.concurrent.Future<java.lang.String>
getServerStatusString(java.lang.String queueName)
Gets the status string for the queue specified (e.g.abstract java.util.concurrent.Future<java.lang.String>
getServerStatusString(java.lang.String queueName, java.util.UUID player)
Gets the status string for the queue specified (e.g.abstract java.util.concurrent.Future<MessagedResponse<java.lang.Integer>>
getTotalPositions(java.util.UUID player)
Gets the total number of players who are in queue with the playerabstract java.util.concurrent.Future<java.lang.Boolean>
isInQueue(java.util.UUID player)
abstract void
sudoQueue(java.util.UUID player, java.lang.String queueName)
Emulate the player running the queue command for a certain server, including any permission checks
-
-
-
Field Detail
-
INSTANCE
public static AjQueueSpigotAPI INSTANCE
-
-
Method Detail
-
getInstance
public static AjQueueSpigotAPI getInstance()
Gets the instance of the ajQueue spigot API- Returns:
- the ajQueue API
-
isInQueue
public abstract java.util.concurrent.Future<java.lang.Boolean> isInQueue(java.util.UUID player)
-
addToQueue
public abstract java.util.concurrent.Future<java.lang.Boolean> addToQueue(java.util.UUID player, java.lang.String queueName)
Adds a player to a queue (bypassing any permission checks that would prevent it)- Parameters:
player
- The player to be addedqueueName
- The server or group to add the player to- Returns:
- True if adding was successful, false if not.
-
sudoQueue
public abstract void sudoQueue(java.util.UUID player, java.lang.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 forqueueName
- The queue to send the player to
-
getQueueName
public abstract java.util.concurrent.Future<MessagedResponse<java.lang.String>> getQueueName(java.util.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
-
getPosition
public abstract java.util.concurrent.Future<MessagedResponse<java.lang.Integer>> getPosition(java.util.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 java.util.concurrent.Future<MessagedResponse<java.lang.Integer>> getTotalPositions(java.util.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 java.util.concurrent.Future<java.lang.Integer> getPlayersInQueue(java.lang.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 java.util.concurrent.Future<java.lang.String> getServerStatusString(java.lang.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 java.util.concurrent.Future<java.lang.String> getServerStatusString(java.lang.String queueName, java.util.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 queueplayer
- the player to check with- Returns:
- The status string for the queue you specified.
-
getEstimatedTime
public abstract java.util.concurrent.Future<MessagedResponse<java.lang.String>> getEstimatedTime(java.util.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
-
-