Follow the leader
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

46 lines
1.4KB

  1. using System.Reflection;
  2. using IllusionPlugin;
  3. using GamecraftModdingAPI;
  4. namespace Leadercraft
  5. {
  6. public class LeadercraftPlugin : IPlugin // the Illusion Plugin Architecture (IPA) will ignore classes that don't implement IPlugin'
  7. {
  8. public string Name { get; } = Assembly.GetExecutingAssembly().GetName().Name; // mod name
  9. public string Version { get; } = Assembly.GetExecutingAssembly().GetName().Version.ToString(); // mod & assembly version
  10. // called when Gamecraft shuts down
  11. public void OnApplicationQuit()
  12. {
  13. // Shutdown this mod
  14. GamecraftModdingAPI.Utility.Logging.LogDebug($"{Name} has shutdown");
  15. // Shutdown the Gamecraft modding API last
  16. GamecraftModdingAPI.Main.Shutdown();
  17. }
  18. // called when Gamecraft starts up
  19. public void OnApplicationStart()
  20. {
  21. // Initialize the Gamecraft modding API first
  22. GamecraftModdingAPI.Main.Init();
  23. // check out the modding API docs here: https://mod.exmods.org/
  24. // Initialize this mod
  25. GamecraftModdingAPI.Utility.Logging.LogDebug($"{Name} has started up");
  26. }
  27. // unused methods
  28. public void OnFixedUpdate() { } // called once per physics update
  29. public void OnLevelWasInitialized(int level) { } // called after a level is initialized
  30. public void OnLevelWasLoaded(int level) { } // called after a level is loaded
  31. public void OnUpdate() { } // called once per rendered frame (frame update)
  32. }
  33. }