Developer API

Importing via dependency managers

Before you can actually start integrating uQueue into you code, you first have to import it into your project.

Importing via Maven

To import the uQueue API via Maven, you should add the repository and dependency to your pom.xml file like below.

Replace {VERSION} with the version of uQueue you want to use.

<repositories>
	<repository>
		<id>noahvdaa</id>
		<url>https://repo.noah.pm/repository/maven-releases/</url>
	</repository>
</repositories>
<dependencies>
	<dependency>
		<groupId>me.noahvdaa.uqueue</groupId>
		<artifactId>uqueue-api</artifactId>
		<version>{VERSION}</version>
		<type>jar</type>
		<scope>provided</scope>
	</dependency>
	<dependency>
		<groupId>me.noahvdaa.uqueue</groupId>
		<artifactId>uqueue-api</artifactId>
		<version>{VERSION}</version>
		<type>javadoc</type>
		<scope>provided</scope>
	</dependency>
</dependencies>

Importing via Gradle

To import the uQueue API via Gradle, add the repository and dependency to your Gradle.build file like in this example below.

Replace {VERSION} with the version of uQueue you want to use.

repositories {
    maven {
        url = 'https://repo.noah.pm/repository/maven-releases/'
    }
}

dependencies {
    compileOnly 'me.noahvdaa.uqueue.uqueue-api:{VERSION}'
}

Importing without a dependency manager

If you're not using a dependency manager, you can grab the latest version from Github Releases. After downloading the API, you can add it to your build path.

Next steps

Now that you've added the plugin API to your dependency manager, you can go to the next step: Adding as a plugin dependency.

Adding as a plugin dependency

Now that you've added uQueue to your dependency manager, you should tell BungeeCord to load your plugin AFTER uQueue is loaded, by adding uQueue as a (soft)depend. If your plugin absolutely needs uQueue, you should use a depend. If it supports an optional integration, you shoudl use a softdepend.

Depending on which type of depend you're going to be looking, take a look at these example bungee.yml files.

Softdepend example

name: ExamplePlugin
version: 1.0.0
author: author
main: your.main.path.here
softdepends: [uQueue] # The plugin CAN integrate with uQueue, but doesn't NEED it.

Depend example

name: ExamplePlugin
version: 1.0.0
author: author
main: your.main.path.here
depends: [uQueue] # The plugin MUST integrate with uQueue.

Next steps

Now that you've added the plugin as a BungeeCord dependency, you can start interacting with it via code.

Getting the plugin object.

Now that you've added uQueue as a dependency in both your dependency manager and bungee.yml, it's finally time to start using it in code! Adding the following to your onEnable, to get a uQueue object you can interact with.

if(getProxy().getPluginManager().getPlugin("uQueue") != null){
	UQueuePlugin uQueue = (UQueuePlugin) getProxy().getPluginManager().getPlugin("uQueue");
}

What's next?

Now that you can interact with the uQueue API, it's time to make something amazing! If you're looking for some examples, check out the Example Integration Plugin or the Javadoc.