Code Monkey home page Code Monkey logo

phoenix-api's Introduction

Phoenix-API

This is the API for Phoenix & pxQueue!

Installing

You can either shade this repository into your plugin, or run it as a plugin by itself.

  1. Clone this repository
  2. Enter the directory: cd Phoenix-API
  3. 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.0</version>
    <scope>provided</scope>
</dependency>

Usage

To access PhoenixAPI, you can 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;

Examples

Example usage of PhoenixAPI

Getting a player's highest rank:

SharedAPI api = SharedAPI.getInstance();
Profile profile = api.getProfileHandler().getByUuid("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("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");

phoenix-api's People

Contributors

creaxxog avatar bermiin avatar devdrizzy avatar lightsparkk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.