From eba3e6e2e4c24df43bdeba50599189989bcb6345 Mon Sep 17 00:00:00 2001 From: Mgazul Date: Sat, 27 Apr 2024 20:24:48 +0800 Subject: [PATCH] Update DownloadSource.CHINA --- .../java/com/mohistmc/network/download/DownloadSource.java | 6 +++--- src/main/java/com/mohistmc/MohistConfig.java | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/fmllauncher/java/com/mohistmc/network/download/DownloadSource.java b/src/fmllauncher/java/com/mohistmc/network/download/DownloadSource.java index f7df2c97ab..22ec5ddebf 100644 --- a/src/fmllauncher/java/com/mohistmc/network/download/DownloadSource.java +++ b/src/fmllauncher/java/com/mohistmc/network/download/DownloadSource.java @@ -29,7 +29,7 @@ public enum DownloadSource { MOHIST("https://maven.mohistmc.com/"), - CHINA("http://s1.devicloud.cn:25119/"), + CHINA("https://libraries.mohistmc.cn:25119/releases/"), GITHUB("https://mohistmc.github.io/maven/"); String url; @@ -44,10 +44,10 @@ public String getUrl() { } public static DownloadSource get() { - String ds = MohistConfigUtil.sMohist("libraries_downloadsource", defaultSource.name()); + String ds = MohistConfigUtil.sMohist("mohist.libraries_downloadsource", defaultSource.name()); for (DownloadSource me : DownloadSource.values()) { if (me.name().equalsIgnoreCase(ds)) { - if (isDown(me.url) != 200) return GITHUB; + if (isDown(me.url.replace("releases/", "")) != 200) return GITHUB; return me; } } diff --git a/src/main/java/com/mohistmc/MohistConfig.java b/src/main/java/com/mohistmc/MohistConfig.java index 7d1142a5fd..6aa6eeac52 100644 --- a/src/main/java/com/mohistmc/MohistConfig.java +++ b/src/main/java/com/mohistmc/MohistConfig.java @@ -12,6 +12,7 @@ import com.mohistmc.command.UpdateMohistCommand; import com.mohistmc.command.WhitelistModsCommand; import com.mohistmc.plugins.WorldCommand; +import com.mohistmc.util.i18n.i18n; import java.io.File; import java.io.IOException; import java.lang.reflect.InvocationTargetException; @@ -170,6 +171,7 @@ private static double getDouble(String path, double def) { public static List networkmanager_intercept; public static boolean hideJoinModsList; public static boolean check_update_auto_download; + public static String libraries_downloadsource; private static void mohist() { show_logo = getBoolean("mohist.show_logo", true); @@ -189,5 +191,6 @@ private static void mohist() { hideJoinModsList = getBoolean("forge.hidejoinmodslist", false); networkmanager_intercept = getList("mohist.networkmanager.intercept", new ArrayList<>()); check_update_auto_download = getBoolean("mohist.check_update_auto_download", false); + libraries_downloadsource = getString("mohist.libraries_downloadsource", i18n.isCN() ? "CHINA" : "MOHIST"); } } \ No newline at end of file