This is the API for Phoenix & pxQueue!
You can either shade this repository into your plugin, or run it as a plugin by itself.
- Clone this repository
- Enter the directory:
cd Phoenix-API
- Build & install with Maven:
mvn clean install
OR
You can get PhoenixAPI directly from our maven repository:
<repositories>
<repository>
<id>refine-public</id>
<url>https://maven.refinedev.xyz/repository/public-repo/</url>
</repository>
</repositories>
Next, add PhoenixAPI to your project's dependencies via Maven
Add this to your pom.xml
under <dependencies>
:
<dependency>
<groupId>xyz.refinedev.phoenix</groupId>
<artifactId>pxAPI</artifactId>
<version>1.7.5.1</version>
<scope>provided</scope>
</dependency>
To access PhoenixAPI, you can use these two methods
For global (non-bukkit specific) stuff such as profiles, ranks, punishments, etc... use:
SharedAPI api = SharedAPI.getInstance();
For bukkit specific features such as RebootHandler, ChatHandler, etc... use:
Phoenix phoenix = Phoenix.getInstance();
To access QueueAPI, you can use:
QueueAPI qApi = QueueAPI.INSTANCE;
Example usage of PhoenixAPI
Getting a player's highest rank:
SharedAPI api = SharedAPI.getInstance();
Profile profile = api.getProfileHandler().getProfile(UUID.fromString("447e2ed3-1cf5-4e73-9160-e3c5e195ed7d"));
if (profile != null) {
player.sendMessage(profile.getName() + "'s highest rank is " + profile.getHighestRank().getName());
}
Obtaining a information about a player in Queue:
QueueAPI qApi = QueueAPI.INSTANCE;
Queue queue = qApi.getPlayerQueue(UUID.fromString("447e2ed3-1cf5-4e73-9160-e3c5e195ed7d"));
if (queue != null) {
player.sendMessage("Player is currently queued for " + queue.getName());
return;
}
player.sendMessage("Player is currently not in a queue");