Hook into OreAnnouncer

OreAnnouncer offers some API to work with. They are currently in development.

Importing OreAnnouncer

Maven

<repositories>
  <repository>
    <id>codemc-repo</id>
    <url>https://repo.codemc.org/repository/maven-public/</url>
  </repository>
</repositories>

<dependencies>
  <dependency>
    <groupId>com.alessiodp.oreannouncer</groupId>
    <artifactId>oreannouncer-api</artifactId>
    <version>2.3.1</version>
  </dependency>
</dependencies>

Gradle

repositories {
    maven {
        name = 'codemc-repo'
        url = 'https://repo.codemc.org/repository/maven-public/'
    }
}

dependencies {
    compileOnly group: 'com.alessiodp.oreannouncer', name: 'oreannouncer-api', version: '2.3.1'
}

Implementing OreAnnouncer

Open plugin.yml and insert OreAnnouncer as depend (or soft-depend):

depend: [OreAnnouncer]
soft-depend: [OreAnnouncer]

Before hook into it, be sure its enabled!

if (getServer().getPluginManager().getPlugin("OreAnnouncer") != null) {
    if (getServer().getPluginManager().getPlugin("OreAnnouncer").isEnabled()) {
        // OreAnnouncer is enabled
    }
}

API Methods

OreAnnouncer offers a class called OreAnnouncerAPI, you can initialize it to call API methods. This is how you can use it:

OreAnnouncerAPI api = OreAnnouncer.getApi();
OAPlayer player = api.getOAPlayer(simplePlayer.getUniqueId()); // Get the player
if (player.haveAlertsOn()) {
  // Alerts enabled
} else {
  // Alers disabled
}

Javadoc

You can find the Javadoc here.