mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-20 01:46:13 +00:00
Address code review round 2
This commit is contained in:
1 parent
b688bfa978
commit
bfc539bd74
7 files changed
+75
-52
No files matched your search
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using BepInEx.Bootstrap;
|
||||
using BepInEx.Configuration;
|
||||
using BepInEx.Contract;
|
||||
@@ -14,8 +15,15 @@ namespace BepInEx.NET.Common
|
||||
|
||||
HarmonyInstance = new Harmony("BepInEx.Plugin." + metadata.GUID);
|
||||
|
||||
Info = BaseChainloader<BasePlugin>.GetPluginInfoFromGuid(metadata.GUID);
|
||||
Info.Instance = this;
|
||||
if (BaseChainloader<BasePlugin>.Instance.TryGetPluginInfoFromGuid(metadata.GUID, out var pluginInfo))
|
||||
{
|
||||
Info = pluginInfo;
|
||||
Info.Instance = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidOperationException($"The plugin information for {metadata.GUID} couldn't be found on the chainloader");
|
||||
}
|
||||
|
||||
Logger = BepInEx.Logging.Logger.CreateLogSource(metadata.Name);
|
||||
|
||||
|
||||
Reference in new issue
Block a user