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:
- Replace
extends JavaPlugin
toextends BackendPlugin
- Remove
instance = this
orgetInstance()
, useBackendPlugin.getInstance()
instead - Change
onEnable()
towhenInitialize()
- Change
onDisable()
towhenUnloaded()
- Remove any
getDataFolder()
or creation of it. Harmony already creates it for you - Change
getLogger()
togetOwnLogger()
(Optional, If you feel comfortable with Spigot logger it's fine) - Remove any checks for legacy versions or Folia. Harmony does it with
isFolia()
andisLegacy()
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
}
}