downloadLibraries method
Downloads all required library files for the specified Minecraft version.
versionInfo
The version information containing library dependencies and download URLs.
Throws an exception if the download process fails.
Implementation
Future<void> downloadLibraries(VersionInfo versionInfo) async {
try {
final libraryDownloader = LibraryDownloader(
gameDir: _gameDir,
onDownloadProgress: _onDownloadProgress,
onOperationProgress: _onOperationProgress,
progressReportRate: _progressReportRate,
);
await libraryDownloader.downloadLibraries(versionInfo);
await libraryDownloader.completionFuture;
} catch (e) {
debugPrint('Error downloading libraries: $e');
throw Exception('Failed to download libraries: $e');
}
}