mirror of
https://github.com/IHasName/CustomHeads.git
synced 2024-12-01 06:53:22 +01:00
Small Downloader Bug Fix
This commit is contained in:
parent
9d530f93d1
commit
dc147bfc2d
@ -51,6 +51,7 @@ public class GitHubDownloader {
|
|||||||
private static void getResponseAsJson(String url, FetchResult<JsonElement> fetchResult) {
|
private static void getResponseAsJson(String url, FetchResult<JsonElement> fetchResult) {
|
||||||
if (responseCache.containsKey(url)) {
|
if (responseCache.containsKey(url)) {
|
||||||
fetchResult.success(responseCache.get(url).getData());
|
fetchResult.success(responseCache.get(url).getData());
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -137,27 +138,6 @@ public class GitHubDownloader {
|
|||||||
exception.printStackTrace();
|
exception.printStackTrace();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// getResponseAsJson(apiURLFormatted + "/releases", new FetchResult<JsonElement>() {
|
|
||||||
// public void success(JsonElement js) {
|
|
||||||
// JsonArray releaseList = js.getAsJsonArray();
|
|
||||||
// JsonObject release = null;
|
|
||||||
// for (JsonElement jsonElement : releaseList) {
|
|
||||||
// if (jsonElement.getAsJsonObject().get("tag_name").getAsString().equals(tagName)) {
|
|
||||||
// release = jsonElement.getAsJsonObject();
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (release == null)
|
|
||||||
// throw new NullPointerException("Cannot find release with Tag: " + tagName);
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public void error(Exception exception) {
|
|
||||||
// Bukkit.getLogger().log(Level.WARNING, "Failed to fetch latest Data", exception);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void downloadLatest(String assetName, File downloadTo, AsyncFileDownloader.AfterTask... afterTask) {
|
public void downloadLatest(String assetName, File downloadTo, AsyncFileDownloader.AfterTask... afterTask) {
|
||||||
|
Loading…
Reference in New Issue
Block a user