-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathPlugin.cs
46 lines (38 loc) · 1.3 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
using BepInEx;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using System.Reflection;
using UnityEngine;
using VampireCommandFramework;
using static Bloodcraft.Services.ConfigService.ConfigInitialization;
using static Bloodcraft.Services.DataService.PlayerDataInitialization;
namespace Bloodcraft;
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
internal class Plugin : BasePlugin
{
Harmony _harmony;
internal static Plugin Instance { get; private set; }
public static Harmony Harmony => Instance._harmony;
internal static ManualLogSource LogInstance => Instance.Log;
public override void Load()
{
Instance = this;
if (Application.productName != "VRisingServer")
{
LogInstance.LogInfo("Bloodcraft is a server mod and will not continue loading on the client.");
return;
}
_harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly());
InitializeConfig();
CommandRegistry.RegisterAll();
LoadPlayerData();
Core.Log.LogInfo($"{MyPluginInfo.PLUGIN_NAME}[{MyPluginInfo.PLUGIN_VERSION}] loaded!");
}
public override bool Unload()
{
Config.Clear();
_harmony.UnpatchSelf();
return true;
}
}