46 lines
No EOL
1.4 KiB
C#
46 lines
No EOL
1.4 KiB
C#
using System.Reflection;
|
|
|
|
using IllusionPlugin;
|
|
using GamecraftModdingAPI;
|
|
|
|
namespace Leadercraft
|
|
{
|
|
public class LeadercraftPlugin : IPlugin // the Illusion Plugin Architecture (IPA) will ignore classes that don't implement IPlugin'
|
|
{
|
|
public string Name { get; } = Assembly.GetExecutingAssembly().GetName().Name; // mod name
|
|
|
|
public string Version { get; } = Assembly.GetExecutingAssembly().GetName().Version.ToString(); // mod & assembly version
|
|
|
|
// called when Gamecraft shuts down
|
|
public void OnApplicationQuit()
|
|
{
|
|
// Shutdown this mod
|
|
GamecraftModdingAPI.Utility.Logging.LogDebug($"{Name} has shutdown");
|
|
|
|
// Shutdown the Gamecraft modding API last
|
|
GamecraftModdingAPI.Main.Shutdown();
|
|
}
|
|
|
|
// called when Gamecraft starts up
|
|
public void OnApplicationStart()
|
|
{
|
|
// Initialize the Gamecraft modding API first
|
|
GamecraftModdingAPI.Main.Init();
|
|
// check out the modding API docs here: https://mod.exmods.org/
|
|
|
|
// Initialize this mod
|
|
|
|
GamecraftModdingAPI.Utility.Logging.LogDebug($"{Name} has started up");
|
|
}
|
|
|
|
// unused methods
|
|
|
|
public void OnFixedUpdate() { } // called once per physics update
|
|
|
|
public void OnLevelWasInitialized(int level) { } // called after a level is initialized
|
|
|
|
public void OnLevelWasLoaded(int level) { } // called after a level is loaded
|
|
|
|
public void OnUpdate() { } // called once per rendered frame (frame update)
|
|
}
|
|
} |