Skip to content

Commit

Permalink
343
Browse files Browse the repository at this point in the history
Mgazul committed Sep 12, 2023
1 parent d1e3cba commit dcc7267
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -816,7 +816,7 @@ task setup() {
}

static def JenkinsNumber() {
return 342
return 343
/*
try {
def conn = new URL("https://ci.codemc.io/job/MohistMC/job/Mohist-1.12.2/api/json").openConnection()
3 changes: 2 additions & 1 deletion src/main/java/com/mohistmc/configuration/MohistConfig.java
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

public class MohistConfig extends ConfigBase {

@@ -32,7 +33,7 @@ public class MohistConfig extends ConfigBase {
public final StringSetting requirementsModVersionRange = new StringSetting(this, "messages.Requirements-Mod-Version-range", Message.getString("requirements.mod.version-range"));

public final StringSetting server_type = new StringSetting(this, "mohist.server-type", "FML");
public final StringSetting lang = new StringSetting(this, "mohist.lang", "xx_XX");
public final StringSetting lang = new StringSetting(this, "mohist.lang", Locale.getDefault().toString());
public final StringSetting console_name = new StringSetting(this, "mohist.console_name", "Server");
public final BoolSetting support_nocmd = new BoolSetting(this, "mohist.support_nocmd", false);
// Bukkit Event Canceled
6 changes: 3 additions & 3 deletions src/main/java/com/mohistmc/util/i18n/Message.java
Original file line number Diff line number Diff line change
@@ -21,14 +21,14 @@ public static String getFormatString(String key, Object[] f) {

public static String getLocale(int key) {
File f = new File("mohist-config", "mohist.yml");
String locale = MohistConfigUtil.getString(f, "lang:", "xx_XX");
String locale = MohistConfigUtil.getString(f, "lang:", Locale.getDefault().toString());
if (locale.length() == 5) {
String language = locale.substring(0, 2);
String country = locale.substring(3, 5);
if (key == 1) return language;
if (key == 2) return country;
}
return "xx_XX";
return Locale.getDefault().toString();
}

public static String getLanguage() {
@@ -45,6 +45,6 @@ public static String getLocale() {

public static boolean isCN() {
TimeZone timeZone = TimeZone.getDefault();
return Locale.getDefault().getCountry().equals("CN") ||timeZone.getID().equals("Asia/Shanghai") || rb.getLocale().getCountry().equals("CN");
return Locale.getDefault().getCountry().equals("CN") || timeZone.getID().equals("Asia/Shanghai") || rb.getLocale().getCountry().equals("CN");
}
}
2 changes: 0 additions & 2 deletions src/main/resources/configurations/mohist.yml
Original file line number Diff line number Diff line change
@@ -27,12 +27,10 @@ mohist:
check_update: true
server-type: FML
downloadfile_command_enabled: false
lang: xx_XX
console_name: Server
forge_can_call_bukkit: false
CloseChatInConsole: false
check_libraries: true
libraries_downloadsource: MOHIST
support_nocmd: false
disable_mods_blacklist: false
disable_plugins_blacklist: false

0 comments on commit dcc7267

Please sign in to comment.