Skip to content

Implementation

NJDaeger edited this page Jun 1, 2017 · 2 revisions

Implementing CoalesceCore into your plugin


Adding it as a dependency in your plugin yml

To begin, we will always want to make sure CoalesceCore is inside the plugin.yml to assure the server, and your plugin, that the correct dependencies are loaded.

This is the plugin.yml for our plugin TextToBlock. If you refer down to the "depend" line in the TextToBlock plugin.yml, you will see CoalesceCore. If we were to try to run the server without CoalesceCore installed, then this plugin, and any other plugins that depend on CoalesceCore, would not start.

name: TextToBlock
version: 1.0.0
main: com.coalesce.ttb.TextToBlock
author: ProjectCoalesce
depend: [CoalesceCore]

Your Main Class

Unlike a normal Bukkit/Spigot Plugin, a plugin made with CoalesceCore cannot extend JavaPlugin in its main class. Instead of using JavaPlugin, we use CoPlugin.

package com.coalesce.example;

import com.coalesce.plugin.CoPlugin;

public final class Main extends CoPlugin {
    
}

Rather than the usual onEnable, onDisable, and onLoad; we have onPluginEnable, onPluginDisable, and onPluginLoad. They all function the exact same way as their counterpart.

Clone this wiki locally