downloadClientJar method
Downloads the Minecraft client JAR file for the specified version.
versionInfo
The version information containing download URLs.
versionId
The Minecraft version identifier.
Throws an exception if the download fails.
Implementation
Future<void> downloadClientJar(
VersionInfo versionInfo,
String versionId,
) async {
try {
final libraryDownloader = LibraryDownloader(
gameDir: _gameDir,
onDownloadProgress: _onDownloadProgress,
onOperationProgress: _onOperationProgress,
progressReportRate: _progressReportRate,
);
await libraryDownloader.downloadClientJar(versionInfo, versionId);
debugPrint('Downloaded client jar for $versionId');
} catch (e) {
debugPrint('Error downloading client jar: $e');
throw Exception('Failed to download client jar: $e');
}
}