Fix switching download source problem
This commit is contained in:
@@ -172,7 +172,7 @@ public class MinecraftDownloadService extends IMinecraftDownloadService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String apply(Integer t) {
|
public String apply(Integer t) {
|
||||||
return DownloadType.values()[t / 3].getProvider().getVersionsDownloadURL() + suffix;
|
return DownloadType.values()[t / 2].getProvider().getVersionsDownloadURL() + suffix;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,10 +121,13 @@ public class FileDownloadTask extends Task implements PreviousResult<File>, Prev
|
|||||||
if (repeat > 0) {
|
if (repeat > 0) {
|
||||||
HMCLog.warn("Failed to download, repeat: " + repeat);
|
HMCLog.warn("Failed to download, repeat: " + repeat);
|
||||||
if (failedCallbackReturnsNewURL != null) {
|
if (failedCallbackReturnsNewURL != null) {
|
||||||
url = IOUtils.parseURL(failedCallbackReturnsNewURL.apply(repeat));
|
URL tmp = IOUtils.parseURL(failedCallbackReturnsNewURL.apply(repeat));
|
||||||
|
if (tmp != null) {
|
||||||
|
url = tmp;
|
||||||
HMCLog.warn("Switch to: " + url);
|
HMCLog.warn("Switch to: " + url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
|
|
||||||
// Open connection to URL.
|
// Open connection to URL.
|
||||||
|
|||||||
Reference in New Issue
Block a user