Skip to content

Developer API

Moros edited this page Oct 28, 2024 · 3 revisions

Adding Bending to your project

The API artifact is published to the Sonatype snapshots maven repository:

Maven

  <repositories>
    <repository>
        <id>sonatype-oss-snapshots</id>
        <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </repository>
  </repositories>

 <dependency>
    <groupId>me.moros</groupId>
    <artifactId>gaia-api</artifactId>
    <version>2.0.0-SNAPSHOT</version>
    <scope>provided</scope>
</dependency>

Gradle (Kotlin)

repositories {
    maven("https://oss.sonatype.org/content/repositories/snapshots/")
}

dependencies {
    compileOnly("me.moros:gaia-api:2.0.0-SNAPSHOT")
}

Obtaining an instance of the API:

The root API interface is Gaia.

Bukkit

You can obtain it using the Bukkit ServicesManager

RegisteredServiceProvider<Gaia> provider = Bukkit.getServicesManager().getRegistration(Gaia.class);
if (provider != null) {
  Gaia gaiaApi = provider.getProvider();
  // Do stuff with it
}