API Introduction - Oribuin/EternalCrates GitHub Wiki
EternalCrates includes an API to allow users to create their own animations and register them into the plugin. If you have any issues, create an issue or join the support discord.
It is recommended to use Gradle or Maven to include the dependency for the plugin into your plugin, There is no maven repository since this is a premium plugin so you will need to manually compile the plugin into your plugin.
We recommend uploading it to a 'libs' folder, alternatively, you can upload it to a private repository and compile it from there.
repositories {
maven { url "https://repo.rosewooddev.io/repository/public/" }
}
dependencies {
compileOnly 'xyz.oribuin:eternalcrates:1.0.2'
}
<repositories>
<repository>
<id>rosewood-repo</id>
<url>https://repo.rosewooddev.io/repository/public/</url>
</repository>
</repositories>
<dependency>
<groupId>xyz.oribuin</groupId>
<artifactId>eternalcrates</artifactId>
<version>1.0.2</version>
<scope>provided</scope>
</dependency>
You will want to register any animations when the plugin enables, Start by adding the plugin as a depend/softdepend in the plugin.yml, Here's an example.
main: MainClass
name: PluginName
author: YourName
depend: ['EternalCrates']
# softdepend: ['EternalCrates'] # this is an alternative
version: 1.0
description: Registers crate animations using EternalCrates
After adding EternalCrates as a depend/softdepend, Here is how you're going to want to register the animations into the plugin
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
// Check if EternalCrates is enabled.
if (this.getServer().getPluginManager().isPluginEnabled("EternalCrates")) {
AnimationManager.register(new MyAnimation()); // This function registers the animation into the plugin.
}
}
}