forked from decaprime/LeadAHorseToWater
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPlugin.cs
62 lines (55 loc) · 1.81 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
using BepInEx;
using BepInEx.Unity.IL2CPP;
using BepInEx.Logging;
using HarmonyLib;
using System.Reflection;
using Bloodstone.API;
namespace LeadAHorseToWater
{
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
[BepInDependency("gg.deca.VampireCommandFramework", BepInDependency.DependencyFlags.SoftDependency)]
[BepInDependency("gg.deca.Bloodstone")]
[Reloadable]
public class Plugin : BasePlugin, IRunOnInitialized
{
private Harmony _harmony;
public static ManualLogSource LogInstance { get; private set; }
public override void Load()
{
LogInstance = this.Log;
Settings.Initialize(Config);
// Server plugin check
if (!VWorld.IsServer)
{
Log.LogWarning("This plugin is a server-only plugin.");
return;
}
BreedTimerProcess process = new();
process.Setup();
}
public void OnGameInitialized()
{
if (VWorld.IsClient)
{
return;
}
// Plugin startup logic
_harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly());
Log.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} is loaded!");
Log.LogInfo("Trying to find VCF:");
if (VCFCompat.Commands.Enabled)
{
VCFCompat.Commands.Register();
}
else
{
Log.LogError("This mod has commands, you need to install VampireCommandFramework to use them, find wherever you get mods or : https://a.deca.gg/vcf .");
}
}
public override bool Unload()
{
_harmony?.UnpatchSelf();
return true;
}
}
}