-
-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathPlugin.cs
More file actions
48 lines (39 loc) · 1.46 KB
/
Plugin.cs
File metadata and controls
48 lines (39 loc) · 1.46 KB
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
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; 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; this is not an error, and likely just means you're using ServerLaunchFix in which case you may disregard this");
return;
}
// Console.OutputEncoding = System.Text.Encoding.UTF8;
_harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly());
InitializeConfig();
LoadPlayerData();
CommandRegistry.RegisterAll();
Core.Log.LogInfo($"{MyPluginInfo.PLUGIN_NAME}[{MyPluginInfo.PLUGIN_VERSION}] loaded!");
}
public override bool Unload()
{
Config.Clear();
_harmony.UnpatchSelf();
return true;
}
}