Developer API

The Repository

Gradle Kotlin DSL:

maven("https://repo.tarkan.dev")

Gradle Groovy DSL:

maven {
    url 'https://repo.tarkan.dev'
}

Maven:

<repository>
  <id>tarkan-repo</id>
  <url>https://repo.tarkan.dev</url>
</repository>

The dependency

Gradle Kotlin DSL:

implementation('io.puharesource.mc:TitleManager:2.3.1')

Gradle Groovy DSL:

compile group: 'io.puharesource.mc', name: 'TitleManager', version: '2.3.1'

Maven:

<dependency>
   <groupId>io.puharesource.mc</groupId>
   <artifactId>TitleManager</artifactId>
   <version>2.3.1</version>
</dependency>

plugin.yml

If your plugin requires TitleManager, add this line to plugin.yml:

depend: [TitleManager]

If your plugin can run without TitleManager, add this line to plugin.yml instead:

softdepend: [TitleManager]

Getting the API instance

To use the API, get an instance of TitleManagerAPI. Store it when your plugin loads so you can use it later. The examples below use a local variable in the onEnable method.

Java
@Override
public void onEnable() {
  TitleManagerAPI api = (TitleManagerAPI) Bukkit.getServer().getPluginManager().getPlugin("TitleManager");
}
Kotlin

In Kotlin, use the lazy delegate to get and store the TitleManager instance when it is first accessed.

val titleManagerAPI : TitleManagerAPI by lazy { Bukkit.getServer().pluginManager.getPlugin("TitleManager") }