9
0
mirror of https://github.com/Xiao-MoMi/Custom-Fishing.git synced 2025-12-19 15:09:24 +00:00

optimize downloader

This commit is contained in:
XiaoMoMi
2024-07-30 15:23:20 +08:00
parent 5b9c65caf7
commit 35ce90aa65
3 changed files with 10 additions and 4 deletions

View File

@@ -32,7 +32,9 @@ import java.net.URLConnection;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
/**
* Represents a repository which contains {@link Dependency}s.
@@ -75,6 +77,10 @@ public enum DependencyRepository {
repositories.add(repository);
}
}
// 中国大陆优先使用阿里云镜像
if (Locale.getDefault() == Locale.SIMPLIFIED_CHINESE) {
Collections.reverse(repositories);
}
return repositories;
}

View File

@@ -168,9 +168,9 @@ public class TranslationManager {
}
Map<String, String> bundle = new HashMap<>();
YamlDocument document = plugin.getConfigManager().loadConfig("translations" + "\\" + translationFile.getFileName(), '@');
YamlDocument document = plugin.getConfigManager().loadConfig("translations" + File.separator + translationFile.getFileName(), '@');
try {
document.save(new File(plugin.getDataDirectory().toFile(), "translations" + "\\" + translationFile.getFileName()));
document.save(new File(plugin.getDataDirectory().toFile(), "translations" + File.separator + translationFile.getFileName()));
} catch (IOException e) {
throw new IllegalStateException("Could not update translation file: " + translationFile.getFileName(), e);
}

View File

@@ -14,7 +14,7 @@ asm_version=9.7
asm_commons_version=9.7
jar_relocator_version=1.7
h2_driver_version=2.2.224
sqlite_driver_version=3.46.0.0
sqlite_driver_version=3.46.0.1
adventure_bundle_version=4.17.0
adventure_platform_version=4.3.3
sparrow_heart_version=0.34
@@ -36,7 +36,7 @@ bstats_version=3.0.2
geantyref_version=1.3.15
caffeine_version=3.1.8
rtag_version=6290733498
jedis_version=5.1.3
jedis_version=5.1.4
exp4j_version=0.4.8
placeholder_api_version=2.11.6
#invui_version=1.32