fix: issue with main Forge library not downloading correctly from our CDN
This commit is contained in:
parent
5f33907199
commit
02d7b831f2
3 changed files with 8 additions and 4 deletions
|
@ -12,6 +12,7 @@ This changelog only contains the changes that are unreleased. For changes for in
|
||||||
- Add --debug-level option back in
|
- Add --debug-level option back in
|
||||||
- Noisy logs around images for instance/server cards
|
- Noisy logs around images for instance/server cards
|
||||||
- Some incorrect colours on light themes
|
- Some incorrect colours on light themes
|
||||||
|
- Issue with main Forge library not downloading correctly from our CDN
|
||||||
|
|
||||||
### Misc
|
### Misc
|
||||||
- Remove headless dependency from debian package
|
- Remove headless dependency from debian package
|
||||||
|
|
|
@ -39,6 +39,10 @@ public class LibraryTypeAdapter implements JsonDeserializer<Library> {
|
||||||
library = new Gson().fromJson(object, ForgeLibrary.class);
|
library = new Gson().fromJson(object, ForgeLibrary.class);
|
||||||
} else {
|
} else {
|
||||||
library = new Gson().fromJson(object, Library.class);
|
library = new Gson().fromJson(object, Library.class);
|
||||||
|
|
||||||
|
if (library.name.contains("forge") && library.downloads.artifact.url.endsWith("-launcher.jar")) {
|
||||||
|
library.downloads.artifact.url = library.downloads.artifact.url.replace("-launcher.jar", ".jar");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return library;
|
return library;
|
||||||
|
|
|
@ -57,10 +57,9 @@ public class ForgeLibraryTypeAdapter implements JsonDeserializer<ForgeLibrary> {
|
||||||
library.downloads = new Gson().fromJson(object.get("downloads").getAsJsonObject(), Downloads.class);
|
library.downloads = new Gson().fromJson(object.get("downloads").getAsJsonObject(), Downloads.class);
|
||||||
|
|
||||||
if (library.downloads.artifact.url.isEmpty()) {
|
if (library.downloads.artifact.url.isEmpty()) {
|
||||||
// forge installer provides this out the zip, but when the file is removed from
|
// forge installer provides this out the zip (14.23.5.2851 and later), but when
|
||||||
// shared libraries, we need to change the url to grab the launcher jar (same)
|
// the file is removed from shared libraries, we need to add the url
|
||||||
library.downloads.artifact.url = Constants.FORGE_MAVEN_BASE
|
library.downloads.artifact.url = Constants.FORGE_MAVEN_BASE + library.downloads.artifact.path;
|
||||||
+ library.downloads.artifact.path.replace(".jar", "-launcher.jar");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// use our own mirror for Forge downloads
|
// use our own mirror for Forge downloads
|
||||||
|
|
Loading…
Reference in a new issue