-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlugin.cs
65 lines (54 loc) · 2.03 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using BepInEx;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using Bloodstone.API;
using HarmonyLib;
using VampireCommandFramework;
namespace BloodQualityControl;
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
[BepInDependency("gg.deca.VampireCommandFramework")]
[BepInDependency("gg.deca.Bloodstone")]
[Reloadable]
public class Plugin : BasePlugin, IRunOnInitialized
{
Harmony _harmony;
internal static ManualLogSource Logger;
public override void Load()
{
// Plugin startup logic
Logger = Log;
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 commands in the assembly with VCF
CommandRegistry.RegisterAll();
}
public override bool Unload()
{
CommandRegistry.UnregisterAssembly();
_harmony?.UnpatchSelf();
return true;
}
public void OnGameInitialized()
{
PluginServices.Initialize(VWorld.Server);
}
// // Uncomment for example commmand or delete
// /// <summary>
// /// Example VCF command that demonstrated default values and primitive types
// /// Visit https://github.com/decaprime/VampireCommandFramework for more info
// /// </summary>
// /// <remarks>
// /// How you could call this command from chat:
// ///
// /// .bloodqualitycontrol-example "some quoted string" 1 1.5
// /// .bloodqualitycontrol-example boop 21232
// /// .bloodqualitycontrol-example boop-boop
// ///</remarks>
// [Command("bloodqualitycontrol-example", description: "Example command from bloodqualitycontrol", adminOnly: true)]
// public void ExampleCommand(ICommandContext ctx, string someString, int num = 5, float num2 = 1.5f)
// {
// ctx.Reply($"You passed in {someString} and {num} and {num2}");
// }
}