DevelopersยปSDK Documentation

Developers

SDK Documentation

This guide will help you get started with using our SDK with Analyse.


Build Tools

Depending on which build tool you use, you can easily add the Analyse SDK to your project using Gradle or Maven.

Gradle

To add the Analyse SDK into your Gradle project, head to your build.gradle file and add the following to the repositories section like so:

repositories {
    mavenCentral()
}

Then add the following to the dependencies section:

dependencies {
    compileOnly "net.analyse:sdk:2.0.1"
}

That's it! You're now ready to use the Analyse SDK in your project.

Maven

To add the Analyse SDK into your Maven project, head to your pom.xml file and add the following to the dependencies section like so:

<dependency>
    <groupId>net.analyse</groupId>
    <artifactId>sdk</artifactId>
    <version>2.0.1</version>
    <scope>provided</scope>
</dependency>

That's it! You're now ready to use the Analyse SDK in your project.

Accessing the API

To access the API you will need to fetch the live instance of Platform, this provides access to the Platform & Server SDK methods and can be accessed like so:

package net.analyse.example;

import net.analyse.sdk.Analyse;
import net.analyse.sdk.SDK;
import net.analyse.sdk.platform.Platform;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public final class ExampleAnalysePlugin extends JavaPlugin {
    private Platform platform;
    private SDK sdk;
    
    @Override
    public void onEnable() {
        // If Analyse is not enabled, disable the plugin.
        if(!Bukkit.getPluginManager().isPluginEnabled("Analyse")) {
            getLogger().severe("Analyse is not enabled!");
            Bukkit.getPluginManager().disablePlugin(this);
            return;
        }

        // Get the platform instance.
        platform = Analyse.get();
        sdk = platform.getSDK();
    }
}

Now head over to the Platform SDK Documentation to learn how to use the Platform SDK, or the Server SDK Documentation to learn how to use the Server SDK.