使用 EdgeOne 分发 HMCL 元数据 (#4830)

This commit is contained in:
Glavo
2025-11-21 22:02:04 +08:00
committed by GitHub
parent bed87425e7
commit 2695b5c42f
4 changed files with 15 additions and 12 deletions

View File

@@ -82,8 +82,8 @@ public final class BMCLAPIDownloadProvider implements DownloadProvider {
pair("https://authlib-injector.yushi.moe", apiRoot + "/mirrors/authlib-injector"),
pair("https://repo1.maven.org/maven2", "https://mirrors.cloud.tencent.com/nexus/repository/maven-public"),
pair("https://repo.maven.apache.org/maven2", "https://mirrors.cloud.tencent.com/nexus/repository/maven-public"),
pair("https://hmcl-dev.github.io/metadata/cleanroom", "https://alist.8mi.tech/d/mirror/HMCL-Metadata/Auto/cleanroom"),
pair("https://hmcl-dev.github.io/metadata/fmllibs", "https://alist.8mi.tech/d/mirror/HMCL-Metadata/Auto/fmllibs"),
pair("https://hmcl.glavo.site/metadata/cleanroom", "https://alist.8mi.tech/d/mirror/HMCL-Metadata/Auto/cleanroom"),
pair("https://hmcl.glavo.site/metadata/fmllibs", "https://alist.8mi.tech/d/mirror/HMCL-Metadata/Auto/fmllibs"),
pair("https://zkitefly.github.io/unlisted-versions-of-minecraft", "https://alist.8mi.tech/d/mirror/unlisted-versions-of-minecraft/Auto")
// // https://github.com/mcmod-info-mirror/mcim-rust-api
// pair("https://api.modrinth.com", "https://mod.mcimirror.top/modrinth"),

View File

@@ -27,8 +27,8 @@ import java.util.Collections;
public final class CleanroomVersionList extends VersionList<CleanroomRemoteVersion> {
private final DownloadProvider downloadProvider;
private static final String LOADER_LIST_URL = "https://hmcl-dev.github.io/metadata/cleanroom/index.json";
private static final String INSTALLER_URL = "https://hmcl-dev.github.io/metadata/cleanroom/files/cleanroom-%s-installer.jar";
private static final String LOADER_LIST_URL = "https://hmcl.glavo.site/metadata/cleanroom/index.json";
private static final String INSTALLER_URL = "https://hmcl.glavo.site/metadata/cleanroom/files/cleanroom-%s-installer.jar";
public CleanroomVersionList(DownloadProvider downloadProvider) {
this.downloadProvider = downloadProvider;

View File

@@ -96,5 +96,5 @@ public final class ForgeVersionList extends VersionList<ForgeRemoteVersion> {
});
}
public static final URI FORGE_LIST = URI.create("https://hmcl-dev.github.io/metadata/forge/");
public static final URI FORGE_LIST = URI.create("https://hmcl.glavo.site/metadata/forge/");
}

View File

@@ -149,7 +149,7 @@ public final class GameLibrariesTask extends Task<Void> {
Path file = libDir.resolve(fmlLib.name);
if (shouldDownloadFMLLib(fmlLib, file)) {
List<URI> uris = dependencyManager.getDownloadProvider()
.injectURLWithCandidates(fmlLib.getDownloadURI());
.injectURLWithCandidates(fmlLib.downloadUrl());
dependencies.add(new FileDownloadTask(uris, file)
.withCounter("hmcl.install.libraries"));
}
@@ -193,9 +193,12 @@ public final class GameLibrariesTask extends Task<Void> {
if (forgeVersion.startsWith("7.8.1.")) {
return List.of(
new FMLLib("argo-small-3.2.jar", "58912ea2858d168c50781f956fa5b59f0f7c6b51"),
new FMLLib("guava-14.0-rc3.jar", "931ae21fa8014c3ce686aaa621eae565fefb1a6a"),
new FMLLib("asm-all-4.1.jar", "054986e962b88d8660ae4566475658469595ef58"),
new FMLLib("bcprov-jdk15on-148.jar", "960dea7c9181ba0b17e8bab0c06a43f0a5f04e65"),
new FMLLib("guava-14.0-rc3.jar", "931ae21fa8014c3ce686aaa621eae565fefb1a6a",
"https://repo1.maven.org/maven2/com/google/guava/guava/14.0-rc3/guava-14.0-rc3.jar"),
new FMLLib("asm-all-4.1.jar", "054986e962b88d8660ae4566475658469595ef58",
"https://repo1.maven.org/maven2/org/ow2/asm/asm-all/4.1/asm-all-4.1.jar"),
new FMLLib("bcprov-jdk15on-148.jar", "960dea7c9181ba0b17e8bab0c06a43f0a5f04e65",
"https://repo1.maven.org/maven2/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48.jar"),
new FMLLib("deobfuscation_data_1.5.2.zip", "446e55cd986582c70fcf12cb27bc00114c5adfd9"),
new FMLLib("scala-library.jar", "458d046151ad179c85429ed7420ffb1eaf6ddf85")
);
@@ -204,9 +207,9 @@ public final class GameLibrariesTask extends Task<Void> {
return null;
}
private record FMLLib(String name, String sha1) {
public String getDownloadURI() {
return "https://hmcl-dev.github.io/metadata/fmllibs/" + name;
private record FMLLib(String name, String sha1, String downloadUrl) {
FMLLib(String name, String sha1) {
this(name, sha1, "https://hmcl.glavo.site/metadata/fmllibs/" + name);
}
}
}