mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-11-19 13:17:10 +00:00
Reverted method signature change
This commit is contained in:
1 parent
903f6250b6
commit
6fce7b20b3
2 files changed
+4
-3
No files matched your search
@@ -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(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}");
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user