mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-17 15:57:18 -04:00
Fix switching download source problem
This commit is contained in:
parent
6aaad71126
commit
115bc85c58
@ -172,7 +172,7 @@ public class MinecraftDownloadService extends IMinecraftDownloadService {
|
||||
|
||||
@Override
|
||||
public String apply(Integer t) {
|
||||
return DownloadType.values()[t / 3].getProvider().getVersionsDownloadURL() + suffix;
|
||||
return DownloadType.values()[t / 2].getProvider().getVersionsDownloadURL() + suffix;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -121,8 +121,11 @@ public class FileDownloadTask extends Task implements PreviousResult<File>, Prev
|
||||
if (repeat > 0) {
|
||||
HMCLog.warn("Failed to download, repeat: " + repeat);
|
||||
if (failedCallbackReturnsNewURL != null) {
|
||||
url = IOUtils.parseURL(failedCallbackReturnsNewURL.apply(repeat));
|
||||
HMCLog.warn("Switch to: " + url);
|
||||
URL tmp = IOUtils.parseURL(failedCallbackReturnsNewURL.apply(repeat));
|
||||
if (tmp != null) {
|
||||
url = tmp;
|
||||
HMCLog.warn("Switch to: " + url);
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user