public class MinecraftDownloaderImpl extends Object implements MinecraftDownloader
| Constructor and Description |
|---|
MinecraftDownloaderImpl(DownloaderService downloader,
ExecutorService executor,
MinecraftDownloadProvider downloadProvider,
int tries,
boolean checkLibrariesHash,
boolean checkAssetsHash) |
| Modifier and Type | Method and Description |
|---|---|
<T> Future<T> |
download(CombinedDownloadTask<T> task,
CombinedDownloadCallback<T> callback)
Submits a combined download task asynchronously.
|
<T> Future<T> |
download(CombinedDownloadTask<T> task,
CombinedDownloadCallback<T> callback,
int tries)
Submits a combined download task asynchronously.
|
<T> Future<T> |
download(DownloadTask<T> task,
DownloadCallback<T> callback)
Submits a download task asynchronously.
|
<T> Future<T> |
download(DownloadTask<T> task,
DownloadCallback<T> callback,
int tries)
Submits a download task asynchronously.
|
Future<Version> |
downloadIncrementally(MinecraftDirectory dir,
String version,
CombinedDownloadCallback<Version> callback)
Downloads a minecraft version incrementally and asynchronously.
|
Future<RemoteVersionList> |
fetchRemoteVersionList(CombinedDownloadCallback<RemoteVersionList> callback)
Fetches the remote version list of the game asynchronously.
|
boolean |
isShutdown()
Returns true if this executor has been shutdown.
|
void |
shutdown()
Shutdown the executor.
|
public MinecraftDownloaderImpl(DownloaderService downloader, ExecutorService executor, MinecraftDownloadProvider downloadProvider, int tries, boolean checkLibrariesHash, boolean checkAssetsHash)
public void shutdown()
Shutdownableshutdown in interface Shutdownablepublic boolean isShutdown()
ShutdownableisShutdown in interface Shutdownablepublic <T> Future<T> download(DownloadTask<T> task, DownloadCallback<T> callback)
Downloaderdownload in interface DownloaderT - the result of the tasktask - the download taskcallback - download callbackpublic <T> Future<T> download(DownloadTask<T> task, DownloadCallback<T> callback, int tries)
Downloader
The task will be retried only when an IOException occurs.
tries is the max number of tries. For example: If tries==1, the download won't be
retried
(try 1 time, retry 0 time); If tries==5, the download will be retried at most 4 times.
download in interface DownloaderT - the result of the tasktask - the download taskcallback - download callbacktries - the max number of triespublic <T> Future<T> download(CombinedDownloadTask<T> task, CombinedDownloadCallback<T> callback)
CombinedDownloaderdownload in interface CombinedDownloaderT - the type of the CombinedDownloadTasktask - download taskcallback - download callbackpublic <T> Future<T> download(CombinedDownloadTask<T> task, CombinedDownloadCallback<T> callback, int tries)
CombinedDownloaderdownload in interface CombinedDownloaderT - the type of the CombinedDownloadTasktask - download taskcallback - download callbacktries - the max number of tries for each sub download taskpublic Future<Version> downloadIncrementally(MinecraftDirectory dir, String version, CombinedDownloadCallback<Version> callback)
MinecraftDownloaderThe method will check the asset files, library files, game jars. And downloads the missing or broken ones.
downloadIncrementally in interface MinecraftDownloaderdir - the minecraft dirversion - the version to downloadcallback - the callbackpublic Future<RemoteVersionList> fetchRemoteVersionList(CombinedDownloadCallback<RemoteVersionList> callback)
MinecraftDownloaderfetchRemoteVersionList in interface MinecraftDownloadercallback - the callbackCopyright © 2016. All rights reserved.