diff --git a/CHANGELOG.md b/CHANGELOG.md index 27865979..ba328a59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ This changelog only contains the changes that are unreleased. For changes for in - Add --debug-level option back in - Noisy logs around images for instance/server cards - Some incorrect colours on light themes +- Issue with main Forge library not downloading correctly from our CDN ### Misc - Remove headless dependency from debian package diff --git a/src/main/java/com/atlauncher/data/minecraft/LibraryTypeAdapter.java b/src/main/java/com/atlauncher/data/minecraft/LibraryTypeAdapter.java index 1c980b65..d9b29b4c 100644 --- a/src/main/java/com/atlauncher/data/minecraft/LibraryTypeAdapter.java +++ b/src/main/java/com/atlauncher/data/minecraft/LibraryTypeAdapter.java @@ -39,6 +39,10 @@ public class LibraryTypeAdapter implements JsonDeserializer { library = new Gson().fromJson(object, ForgeLibrary.class); } else { 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; diff --git a/src/main/java/com/atlauncher/data/minecraft/loaders/forge/ForgeLibraryTypeAdapter.java b/src/main/java/com/atlauncher/data/minecraft/loaders/forge/ForgeLibraryTypeAdapter.java index 868ee794..067cd886 100644 --- a/src/main/java/com/atlauncher/data/minecraft/loaders/forge/ForgeLibraryTypeAdapter.java +++ b/src/main/java/com/atlauncher/data/minecraft/loaders/forge/ForgeLibraryTypeAdapter.java @@ -57,10 +57,9 @@ public class ForgeLibraryTypeAdapter implements JsonDeserializer { library.downloads = new Gson().fromJson(object.get("downloads").getAsJsonObject(), Downloads.class); if (library.downloads.artifact.url.isEmpty()) { - // forge installer provides this out the zip, but when the file is removed from - // shared libraries, we need to change the url to grab the launcher jar (same) - library.downloads.artifact.url = Constants.FORGE_MAVEN_BASE - + library.downloads.artifact.path.replace(".jar", "-launcher.jar"); + // forge installer provides this out the zip (14.23.5.2851 and later), but when + // the file is removed from shared libraries, we need to add the url + library.downloads.artifact.url = Constants.FORGE_MAVEN_BASE + library.downloads.artifact.path; } // use our own mirror for Forge downloads