diff --git a/src/main/java/net/fabricmc/loom/LoomGradleExtension.java b/src/main/java/net/fabricmc/loom/LoomGradleExtension.java index a867380..3fe00fe 100644 --- a/src/main/java/net/fabricmc/loom/LoomGradleExtension.java +++ b/src/main/java/net/fabricmc/loom/LoomGradleExtension.java @@ -60,6 +60,7 @@ public class LoomGradleExtension { public boolean extractJars = false; public String customManifest = null; public File accessWidener = null; + public Function intermediaryUrl = mcVer -> "https://maven.fabricmc.net/net/fabricmc/intermediary/" + mcVer + "/intermediary-" + mcVer + "-v2.jar"; private List unmappedModsBuilt = new ArrayList<>(); @@ -317,4 +318,10 @@ public class LoomGradleExtension { public boolean ideSync() { return Boolean.parseBoolean(System.getProperty("idea.sync.active", "false")); } + + // Ideally this should use maven, but this is a lot easier + public Function getIntermediaryUrl() { + //Done like this to work around this possibly not being a java string... + return s -> intermediaryUrl.apply(s).toString(); + } } diff --git a/src/main/java/net/fabricmc/loom/providers/MappingsProvider.java b/src/main/java/net/fabricmc/loom/providers/MappingsProvider.java index 887f3f7..e466b2c 100644 --- a/src/main/java/net/fabricmc/loom/providers/MappingsProvider.java +++ b/src/main/java/net/fabricmc/loom/providers/MappingsProvider.java @@ -151,7 +151,7 @@ public class MappingsProvider extends DependencyProvider { // Download and extract intermediary String encodedMinecraftVersion = UrlEscapers.urlFragmentEscaper().escape(minecraftVersion); - String intermediaryArtifactUrl = "https://maven.fabricmc.net/net/fabricmc/intermediary/" + encodedMinecraftVersion + "/intermediary-" + encodedMinecraftVersion + "-v2.jar"; + String intermediaryArtifactUrl = getExtension().getIntermediaryUrl().apply(encodedMinecraftVersion); Path intermediaryJar = mappingsStepsDir.resolve("v2-intermediary-" + minecraftVersion + ".jar"); DownloadUtil.downloadIfChanged(new URL(intermediaryArtifactUrl), intermediaryJar.toFile(), project.getLogger());