namespace Minecraft.Server.FourKit.Plugin; /// /// Base class that every plugin must extend. /// /// public string name => "MyPlugin"; /// public string version => "1.0.0"; /// public string author => "Me"; /// /// public void onEnable() { /* startup logic */ } /// public void onDisable() { /* shutdown logic */ } /// /// public abstract class ServerPlugin { /// /// The name of this plugin. Must be declared in your plugin class. /// public virtual string name { get; } = string.Empty; /// /// The version of this plugin. /// public virtual string version { get; } = "1.0.0"; /// /// The author of this plugin. /// public virtual string author { get; } = "Unknown"; /// /// The server's root directory (where the server executable lives). /// Use this instead of AppContext.BaseDirectory which points /// to the .NET runtime subfolder. Set automatically before /// is called. /// public string serverDirectory { get; internal set; } = string.Empty; /// /// A per-plugin data directory (plugins/<PluginName>/). /// Created automatically if it does not exist. Use this for config /// files, logs, databases, or any plugin-specific storage. /// Set automatically before is called. /// public string dataDirectory { get; internal set; } = string.Empty; /// /// Called when this plugin is enabled /// public virtual void onEnable() { } /// /// Called when this plugin is disabled /// public virtual void onDisable() { } }