package me.zacharias.chat.plugin; import me.zacharias.chat.plugin.annotations.InjectPluginMetadata; import me.zacharias.chat.plugin.annotations.PluginEntryPoint; import me.zacharias.chat.plugin.tool.Tool; import org.jetbrains.annotations.NotNull; /** * Entry point for the plugin, this is required for the plugin to work, and you MUST annotate it with {@link PluginEntryPoint} */ public abstract class Plugin { /** * This shuld be used if {@link PluginEntryPoint#requireData()} is false (default) * @apiNote While in this constructor, it is not safe to assume any plugin is loaded other than potentially defined plugins in {@link PluginEntryPoint#dependencies()}. See {@link this#onInit} */ public Plugin() {} /** * This shuld be used if {@link PluginEntryPoint#requireData()} is true * @apiNote While in this constructor, it is not safe to assume any plugin is loaded other than potentially defined plugins in {@link PluginEntryPoint#dependencies()}. See {@link this#onInit} * @param data the {@link Data} generated by the plugin loader */ public Plugin(Data data) {} /** * This will be called once every plugin has been loaded */ public void onInit(){} /** * This will be called if the core gets a "fetal" exception or fails to fetch certain info */ public void onDisable(){} /** * This will be called after all plugins have been initialised; here it is safe to perform potential stuff where you load data from optional dependencies, or similar things */ public void onEnable(){} /** * The "main" method of a plugin, it will be the one returning a list of all tools you define. * @return An array of all {@link Tool}s you provide in this plugin, see {@link Tool} for definitions or MAL API tool for ideas or examples */ public Tool[] getTools(){ return null; } /** * This represents your plugin's Metadata * @return A {@link PluginMetadata} object representing the metadata for your plugin */ @NotNull public abstract PluginMetadata getMetadata(); }