-
Notifications
You must be signed in to change notification settings - Fork 48
API Getting Started
PlayerParticles contains an API for manipulating a player's particles and adding new styles of your own.
I recommend that you use either Gradle or Maven to include the dependency for PlayerParticles in your project. Do not shade the entire plugin into your jar, it should only be added as an implementation. An alternative to using a dependency manager is to download the jar and reference it within your IDE manually.
Replace $VERSION$
with the version of the plugin you are using. Versions 8.0 and newer are available.
repositories {
maven {
url = 'https://repo.rosewooddev.io/repository/public/'
}
}
dependencies {
implementation 'dev.esophose:playerparticles:$VERSION$'
}
<repositories>
<repository>
<id>rwd-repo</id>
<url>https://repo.rosewooddev.io/repository/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>dev.esophose</groupId>
<artifactId>playerparticles</artifactId>
<version>$VERSION$</version>
<scope>provided</scope>
</dependency>
</dependencies>
In order to use the API, you must first acquire an API instance. An example plugin class that does this can be found below.
import dev.esophose.playerparticles.api.PlayerParticlesAPI;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
public class Example extends JavaPlugin {
private PlayerParticlesAPI ppAPI;
@Override
public void onEnable() {
if (Bukkit.getPluginManager().isPluginEnabled("PlayerParticles")) {
this.ppAPI = PlayerParticlesAPI.getInstance();
}
// When you want to access the API, check if the instance is null
if (this.ppAPI != null) {
// Do stuff with the API here
}
}
}
You will need to add softdepend: [PlayerParticles]
or depend: [PlayerParticles]
to your plugin.yml depending on if your plugin requires PlayerParticles to be installed or not.
For details on how to use the API, the following pages are available: