diff --git a/api/attributes/HotfixableAttribute.cs b/api/attributes/HotfixableAttribute.cs index 7e7abdc4..23c0b9b8 100644 --- a/api/attributes/HotfixableAttribute.cs +++ b/api/attributes/HotfixableAttribute.cs @@ -2,7 +2,7 @@ namespace NeoModLoader.api.attributes; /// /// If a method has this attribute and its mod main class implements , the method will be hotfixed when the mod is reloaded. /// -[AttributeUsage(AttributeTargets.Method)] +[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)] public class HotfixableAttribute : Attribute { diff --git a/utils/ModReloadUtils.cs b/utils/ModReloadUtils.cs index 4d20b546..2f69d47d 100644 --- a/utils/ModReloadUtils.cs +++ b/utils/ModReloadUtils.cs @@ -125,7 +125,8 @@ private static IEnumerable EnumerateTypesRecursive(IEnumerable attribute.AttributeType.FullName == typeof(HotfixableAttribute).FullName + attribute => attribute.AttributeType.FullName == typeof(HotfixableAttribute).FullName + || methodDefinition.DeclaringType.CustomAttributes.Any(attribute => attribute.AttributeType.FullName == typeof(HotfixableAttribute).FullName) ); }