From 095c4629bf9b826affc88b2eac5edb2bae2d58b0 Mon Sep 17 00:00:00 2001 From: FlowArg Date: Sun, 13 Oct 2024 20:36:26 +0200 Subject: [PATCH] Fix cf integration Gradle 8.10.2 update annotations and junit versions --- build.gradle | 8 ++--- gradle/wrapper/gradle-wrapper.properties | 2 +- .../fr/flowarg/flowupdater/FlowUpdater.java | 2 +- .../CurseForgeIntegration.java | 2 +- .../java/fr/flowarg/flowupdater/Updates.java | 33 +++++++++++++++++++ 5 files changed, 40 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index cf33cb0..bd21b90 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ apply plugin: 'maven-publish' apply plugin: 'signing' group 'fr.flowarg' -version '1.9.1' +version '1.9.2' archivesBaseName = "flowupdater" java { @@ -31,11 +31,11 @@ java { dependencies { api 'com.google.code.gson:gson:2.11.0' api 'fr.flowarg:flowmultitools:1.4.4' - api 'org.jetbrains:annotations:24.1.0' + api 'org.jetbrains:annotations:26.0.0' // Only for internal tests - testImplementation 'fr.flowarg:openlauncherlib:3.2.10' - testImplementation 'org.junit.jupiter:junit-jupiter:5.11.0' + testImplementation 'fr.flowarg:openlauncherlib:3.2.11' + testImplementation 'org.junit.jupiter:junit-jupiter:5.11.2' } publishing { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9a0a0e2..18330fc 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/fr/flowarg/flowupdater/FlowUpdater.java b/src/main/java/fr/flowarg/flowupdater/FlowUpdater.java index 8e95766..baa70d8 100644 --- a/src/main/java/fr/flowarg/flowupdater/FlowUpdater.java +++ b/src/main/java/fr/flowarg/flowupdater/FlowUpdater.java @@ -36,7 +36,7 @@ public class FlowUpdater { /** FlowUpdater's version string constant */ - public static final String FU_VERSION = "1.9.1"; + public static final String FU_VERSION = "1.9.2"; /** Vanilla version's object to update/install */ private final VanillaVersion vanillaVersion; diff --git a/src/main/java/fr/flowarg/flowupdater/integrations/curseforgeintegration/CurseForgeIntegration.java b/src/main/java/fr/flowarg/flowupdater/integrations/curseforgeintegration/CurseForgeIntegration.java index fb5d226..7f09bf1 100644 --- a/src/main/java/fr/flowarg/flowupdater/integrations/curseforgeintegration/CurseForgeIntegration.java +++ b/src/main/java/fr/flowarg/flowupdater/integrations/curseforgeintegration/CurseForgeIntegration.java @@ -122,7 +122,7 @@ public String fetchModLink(@NotNull CurseFileInfo curseFileInfo) { logger.warn(String.format("Mod file %s not available. The download can fail because of this! %s", data.get("displayName").getAsString(), jsonResponse)); final String id = Integer.toString(data.get("id").getAsInt()); - downloadURL = String.format("https://mediafiles.forgecdn.net/files/%s/%s/%s", id.substring(0, 4), id.substring(4), fileName); + downloadURL = String.format("https://edge.forgecdn.net/files/%s/%s/%s", id.substring(0, 4), id.substring(4), fileName); } else downloadURL = downloadURLElement.getAsString(); final long fileLength = data.get("fileLength").getAsLong(); diff --git a/src/test/java/fr/flowarg/flowupdater/Updates.java b/src/test/java/fr/flowarg/flowupdater/Updates.java index 3507c42..cda0b37 100644 --- a/src/test/java/fr/flowarg/flowupdater/Updates.java +++ b/src/test/java/fr/flowarg/flowupdater/Updates.java @@ -285,6 +285,39 @@ public static Result testWithNeoForgeUsage() return new Result(updateDir, error, vanilla, neoForge); } + public static Result testWithNeoForgeUsage2() + { + boolean error = false; + final String vanilla = "1.21.1"; + final String neoForge = "21.1.18"; + final Path updateDir = UPDATE_DIR.resolve("neo_forge-" + vanilla); + + try + { + final VanillaVersion version = new VanillaVersion.VanillaVersionBuilder() + .withName(vanilla) + .build(); + + final NeoForgeVersion neoForgeVersion = new NeoForgeVersionBuilder() + .withNeoForgeVersion(neoForge) + .build(); + + final FlowUpdater updater = new FlowUpdater.FlowUpdaterBuilder() + .withVanillaVersion(version) + .withModLoaderVersion(neoForgeVersion) + .build(); + + updater.update(updateDir); + } + catch (Exception e) + { + error = true; + e.printStackTrace(); + } + + return new Result(updateDir, error, vanilla, neoForge); + } + public static class Result { public final Path updateDir;