Files
se-launcher/PluginLoader/Patch/Patch_ComponentRegistered.cs

18 lines
497 B
C#

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();
}
}