-
Notifications
You must be signed in to change notification settings - Fork 0
/
Plugin.cs
41 lines (33 loc) · 1016 Bytes
/
Plugin.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using BepInEx;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using Refined.Commands;
using Refined.Commands.Converters;
using VampireCommandFramework;
namespace Refined;
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
[BepInDependency("gg.deca.VampireCommandFramework")]
[BepInDependency("gg.deca.Bloodstone")]
public partial class Plugin : BasePlugin
{
internal static Harmony _harmony;
public static ManualLogSource Logger;
public override void Load()
{
Logger = Log;
// Plugin startup logic
Log.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} version {MyPluginInfo.PLUGIN_VERSION} is loaded!");
// Harmony patching
_harmony = new Harmony(MyPluginInfo.PLUGIN_GUID);
_harmony.PatchAll(System.Reflection.Assembly.GetExecutingAssembly());
// Register all VCF commands
CommandRegistry.RegisterAll();
}
public override bool Unload()
{
CommandRegistry.UnregisterAssembly();
_harmony?.UnpatchSelf();
return true;
}
}