diff --git a/src/main/java/cn/citycraft/AuthMe/settings/Messages.java b/src/main/java/cn/citycraft/AuthMe/settings/Messages.java index 926c145..3cc4c6e 100644 --- a/src/main/java/cn/citycraft/AuthMe/settings/Messages.java +++ b/src/main/java/cn/citycraft/AuthMe/settings/Messages.java @@ -10,13 +10,6 @@ public class Messages { private static Messages singleton = null; - public static Messages getInstance() { - if (singleton == null) { - singleton = new Messages(); - } - return singleton; - } - private final FileConfig msgcfg; public Messages() { @@ -24,6 +17,13 @@ public class Messages { singleton = this; } + public static Messages getInstance() { + if (singleton == null) { + singleton = new Messages(); + } + return singleton; + } + public String getString(final String string) { return msgcfg.getMessage(string); } @@ -42,10 +42,10 @@ public class Messages { public String[] send(final String msg) { String loc = msgcfg.getMessage(msg); if (loc == null || loc.isEmpty()) { - loc = "错误的语言文件 " + msg + " ; 请联系管理员升级语言文件"; - ConsoleLogger.showError("错误的语言文件 " + msg + " 请检查您的配置文件" + msgcfg.getName() + " !"); + loc = "错误的语言文件 " + msg + " 请联系管理员升级语言文件"; + ConsoleLogger.showError("错误的语言文件 " + msg + " 请检查您的配置文件 " + msgcfg.getName() + " !"); } - return loc.split(Settings.messageSplit); + return loc.split("\n"); } } diff --git a/src/main/java/cn/citycraft/AuthMe/settings/Settings.java b/src/main/java/cn/citycraft/AuthMe/settings/Settings.java index 9a5775f..0eec742 100644 --- a/src/main/java/cn/citycraft/AuthMe/settings/Settings.java +++ b/src/main/java/cn/citycraft/AuthMe/settings/Settings.java @@ -70,6 +70,11 @@ public final class Settings { protected static FileConfig configFile; + public Settings(final AuthMe pl) { + plugin = pl; + configFile = (FileConfig) plugin.getConfig(); + } + /** * Config option for setting and check restricted user by username;ip , * return false if ip and name doesnt amtch with player that join the @@ -188,7 +193,6 @@ public final class Settings { isStopEnabled = configFile.getBoolean("Security.SQLProblem.stopServer", true); reloadSupport = configFile.getBoolean("Security.ReloadCommand.useReloadCommandSupport", true); allowCommands = configFile.getStringList("settings.restrictions.allowCommands"); - messageSplit = configFile.getString("settings.messagesplit", "&n"); if (configFile.contains("allowCommands")) { if (!allowCommands.contains("/login")) { allowCommands.add("/login"); @@ -361,11 +365,6 @@ public final class Settings { } } - public Settings(final AuthMe pl) { - plugin = pl; - configFile = (FileConfig) plugin.getConfig(); - } - public void mergeConfig() { boolean changes = false; if (configFile.contains("Xenoforo.predefinedSalt")) { diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 8ab2d67..653644c 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -44,7 +44,6 @@ DataSource: # 字段 realname 字段名 mySQLRealName: realname settings: - messagesplit: '&n' sessions: # 是否开启 Session 缓存. # 如果开启 Session 玩家可以在特殊情况下自动登录.