embed plugin loader directly into the launcher
This commit is contained in:
18
PluginLoader/Patch/Patch_ComponentRegistered.cs
Normal file
18
PluginLoader/Patch/Patch_ComponentRegistered.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Reflection;
|
||||
using HarmonyLib;
|
||||
using Sandbox.Game.World;
|
||||
using VRage.Game;
|
||||
using VRage.Plugins;
|
||||
|
||||
namespace PluginLoader.Patch;
|
||||
|
||||
[HarmonyPatch(typeof(MySession), "RegisterComponentsFromAssembly")]
|
||||
[HarmonyPatch(new[] { typeof(Assembly), typeof(bool), typeof(MyModContext) })]
|
||||
public static class Patch_ComponentRegistered
|
||||
{
|
||||
public static void Prefix(Assembly assembly)
|
||||
{
|
||||
if (assembly == MyPlugins.GameAssembly)
|
||||
Main.Instance?.RegisterComponents();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user