static BedPatches() { MethodInfo method = typeof(BedPatches).GetMethod("Prefix"); foreach (Type type in GenTypes.AllSubclassesNonAbstract(typeof(Need))) { MethodInfo method2 = type.GetMethod("NeedInterval"); try { HarmonyInit.harmonyInstance.Patch(method2, new HarmonyMethod(method), null, null); } catch (Exception ex) { }; } }