Skip to content

Commit

Permalink
Update DownloadSource.CHINA
Browse files Browse the repository at this point in the history
  • Loading branch information
Mgazul committed Apr 27, 2024
1 parent 71ed4be commit eba3e6e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/mohistmc/MohistConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -170,6 +171,7 @@ private static double getDouble(String path, double def) {
public static List<String> 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);
Expand All @@ -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");
}
}

0 comments on commit eba3e6e

Please sign in to comment.