Setup

As A Dependency

We use jitpack. For any issues please see the documentation. Note: It is important that you DO NOT compile the entire repository into your plugin. This could cause issues with your users and / or others trying to use the API.

Gradle (Groovy)

repositories {
    maven { url = 'https://jitpack.io' }
}

dependencies {
    compileOnly 'com.github.harry0198:MailMe:master-SNAPSHOT'
}

Maven

<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
</repositories>
	
<dependency>
		<groupId>com.github.harry0198</groupId>
		<artifactId>MailMe</artifactId>
		<version>master-SNAPSHOT</version>
		<scope>provided</scope>
</dependency>

Getting an Instance

To use the plugin's inbuilt API you should do the following. Be aware, you may also use the plugin's direct instance to retrieve information but using the API methods is safer.

Plugin plugin = getServer().getPluginManager().getPlugin("MailMe");
if (plugin != null && plugin.isEnabled()) {
    # Older versions may not actually have the API interface. You should check it's installed.
    if (plugin instanceof MailMeAPI) {
        MailMeAPI api = (MailMeAPI) plugin;
    }
}

Remember to add MailMe to your plugin.yml dependencies!

Last updated