Quick Start - rodrigoo-r/Harmony GitHub Wiki

Setup

Harmony changes some things provided by Bukkit. (i.e. the data folder is automatically created if it doesn't exists).

To setup:

  1. Replace extends JavaPlugin to extends BackendPlugin
  2. Remove instance = this or getInstance(), use BackendPlugin.getInstance() instead
  3. Change onEnable() to whenInitialize()
  4. Change onDisable() to whenUnloaded()
  5. Remove any getDataFolder() or creation of it. Harmony already creates it for you
  6. Change getLogger() to getOwnLogger() (Optional, If you feel comfortable with Spigot logger it's fine)
  7. Remove any checks for legacy versions or Folia. Harmony does it with isFolia() and isLegacy()

Example Plugin

Example output:

public final class GreenShield extends BackendPlugin {

    @Override
    public void whenInitialize() {
        final PluginLogger logger = getOwnLogger();
        logger.info("&aHello world!");
        logger.info(
                isLegacy()
        );
    }

    @Override
    public void whenUnloaded() {
        // Plugin shutdown logic
    }
}