Removed parameter that should be calculated to prevent desyncs or type errors

This commit is contained in:
David Higueros committed 2026-11-04 14:23:17 -07:00
1 parent 1132e86f8f
commit 5b0fee0079
2 files changed
+3 -4

No files matched your search

+2 -2
View File
@@ -138,12 +138,12 @@ public static class MiraEventManager
/// <summary>
/// Register a <see cref="MiraEvent"/> handler.
/// </summary>
/// <param name="type">The type of <see cref="MiraEvent"/> event.</param>
/// <param name="methodInfo">The <see cref="MethodInfo"/> of the event handler.</param>
/// <param name="priority">The priority of the event handler. Lower values are called first.</param>
/// <returns>A <see cref="MiraEventHandle"/> to use when unregistering the event.</returns>
public static MiraEventHandle RegisterEventHandler(Type type, MethodInfo methodInfo, int priority = 0)
public static MiraEventHandle RegisterEventHandler(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}");
+1 -2
View File
@@ -197,8 +197,7 @@ public sealed class MiraPluginManager
continue;
}
var paramType = parameters[0].ParameterType;
MiraEventManager.RegisterEventHandler(paramType, method, eventAttribute.Priority);
MiraEventManager.RegisterEventHandler(method, eventAttribute.Priority);
}
}