From 0512cdc2e78184571f0d4eaa71fba9ad5eed3589 Mon Sep 17 00:00:00 2001 From: Mgazul Date: Mon, 27 May 2024 17:53:31 +0800 Subject: [PATCH] Remove DownloadSource.CHINA --- .../com/mohistmc/network/download/DownloadSource.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/fmllauncher/java/com/mohistmc/network/download/DownloadSource.java b/src/fmllauncher/java/com/mohistmc/network/download/DownloadSource.java index 22ec5ddebf..dff5d4ff69 100644 --- a/src/fmllauncher/java/com/mohistmc/network/download/DownloadSource.java +++ b/src/fmllauncher/java/com/mohistmc/network/download/DownloadSource.java @@ -19,9 +19,6 @@ package com.mohistmc.network.download; import com.mohistmc.config.MohistConfigUtil; -import com.mohistmc.util.i18n.i18n; - -import java.io.IOException; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection; @@ -29,11 +26,9 @@ public enum DownloadSource { MOHIST("https://maven.mohistmc.com/"), - CHINA("https://libraries.mohistmc.cn:25119/releases/"), GITHUB("https://mohistmc.github.io/maven/"); - String url; - public static DownloadSource defaultSource = i18n.isCN() ? CHINA : MOHIST; + final String url; DownloadSource(String url) { this.url = url; @@ -44,14 +39,14 @@ public String getUrl() { } public static DownloadSource get() { - String ds = MohistConfigUtil.sMohist("mohist.libraries_downloadsource", defaultSource.name()); + String ds = MohistConfigUtil.sMohist("mohist.libraries_downloadsource", MOHIST.name()); for (DownloadSource me : DownloadSource.values()) { if (me.name().equalsIgnoreCase(ds)) { if (isDown(me.url.replace("releases/", "")) != 200) return GITHUB; return me; } } - return defaultSource; + return MOHIST; } public static int isDown(String s) {