From 6fce7b20b34a80aff7d5320f0413ab09a8f5dc09 Mon Sep 17 00:00:00 2001 From: David Higueros <111460331+TheDavSmasher@users.noreply.github.com> Date: Fri, 6 Nov 2026 13:07:04 -0700 Subject: [PATCH] Reverted method signature change --- MiraAPI/Events/MiraEventManager.cs | 4 ++-- MiraAPI/PluginLoading/MiraPluginManager.cs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/MiraAPI/Events/MiraEventManager.cs b/MiraAPI/Events/MiraEventManager.cs index adfb2627..4d733940 100644 --- a/MiraAPI/Events/MiraEventManager.cs +++ b/MiraAPI/Events/MiraEventManager.cs @@ -138,12 +138,12 @@ public static class MiraEventManager /// /// Register a handler. /// + /// The type of event. /// The of the event handler. /// The priority of the event handler. Lower values are called first. /// A to use when unregistering the event. - public static MiraEventHandle RegisterEventHandler(MethodInfo methodInfo, int priority = 0) + public static MiraEventHandle RegisterEventHandler(Type type, MethodInfo methodInfo, int priority = 0) { - Type type = methodInfo.GetParameters()[0].ParameterType; if (!type.IsAssignableTo(typeof(MiraEvent))) { throw new InvalidOperationException($"Type must be a subclass of MiraEvent: {type.FullName}"); diff --git a/MiraAPI/PluginLoading/MiraPluginManager.cs b/MiraAPI/PluginLoading/MiraPluginManager.cs index 83a784e6..b4815048 100644 --- a/MiraAPI/PluginLoading/MiraPluginManager.cs +++ b/MiraAPI/PluginLoading/MiraPluginManager.cs @@ -197,7 +197,8 @@ public sealed class MiraPluginManager continue; } - MiraEventManager.RegisterEventHandler(method, eventAttribute.Priority); + var paramType = parameters[0].ParameterType; + MiraEventManager.RegisterEventHandler(paramType, method, eventAttribute.Priority); } }