- Java 17 or higher
- A supported environment listed here
repositories {
maven {
name = "grimacSnapshots"
url = uri("https://repo.grim.ac/snapshots")
}
}
dependencies {
// replace %VERSION% with the latest api version
compileOnly 'ac.grim.grimac:GrimAPI:%VERSION%'
}
<repository>
<id>grimac-snapshots</id>
<name>GrimAC Repository</name>
<url>https://repo.grim.ac/snapshots</url>
</repository>
<!-- replace %VERSION% with the latest api version -->
<dependency>
<groupId>ac.grim.grimac</groupId>
<artifactId>GrimAPI</artifactId>
<version>%VERSION%</version>
<scope>provided</scope>
</dependency>
These examples are assuming you are using a bukkit environment
Configure your plugin to depend or softdepend on GrimAC
in your plugin's plugin.yml
:
softdepend: [GrimAC]
Example of obtaining an instance of the API:
if (Bukkit.getPluginManager().isPluginEnabled("GrimAC")) {
RegisteredServiceProvider<GrimAbstractAPI> provider = Bukkit.getServicesManager().getRegistration(GrimAbstractAPI.class);
if (provider != null) {
GrimAbstractAPI api = provider.getProvider();
}
}