From a013a6c54f747d469e5bcd13fd1a202b88c5c2ba Mon Sep 17 00:00:00 2001 From: DNx5 Date: Sat, 3 Oct 2015 13:01:44 +0700 Subject: [PATCH] update Settings --- src/main/java/fr/xephi/authme/Utils.java | 3 ++- src/main/java/fr/xephi/authme/settings/Settings.java | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/fr/xephi/authme/Utils.java b/src/main/java/fr/xephi/authme/Utils.java index bdd156ff..4abde79f 100644 --- a/src/main/java/fr/xephi/authme/Utils.java +++ b/src/main/java/fr/xephi/authme/Utils.java @@ -189,7 +189,8 @@ public class Utils { } public static boolean isUnrestricted(Player player) { - return Settings.isAllowRestrictedIp && !(Settings.getUnrestrictedName == null || Settings.getUnrestrictedName.isEmpty()) && (Settings.getUnrestrictedName.contains(player.getName())); + return Settings.isAllowRestrictedIp && !Settings.getUnrestrictedName.isEmpty() + && (Settings.getUnrestrictedName.contains(player.getName())); } private static boolean useGroupSystem() { diff --git a/src/main/java/fr/xephi/authme/settings/Settings.java b/src/main/java/fr/xephi/authme/settings/Settings.java index 24a72173..b43cf29b 100644 --- a/src/main/java/fr/xephi/authme/settings/Settings.java +++ b/src/main/java/fr/xephi/authme/settings/Settings.java @@ -119,7 +119,6 @@ public final class Settings extends YamlConfiguration { } - @SuppressWarnings("unchecked") public static void loadVariables() { messagesLanguage = checkLang(configFile.getString("settings.messagesLanguage", "en").toLowerCase()); isPermissionCheckEnabled = configFile.getBoolean("permission.EnablePermissionCheck", false); @@ -185,7 +184,7 @@ public final class Settings extends YamlConfiguration { backupWindowsPath = configFile.getString("BackupSystem.MysqlWindowsPath", "C:\\Program Files\\MySQL\\MySQL Server 5.1\\"); isStopEnabled = configFile.getBoolean("Security.SQLProblem.stopServer", true); reloadSupport = configFile.getBoolean("Security.ReloadCommand.useReloadCommandSupport", true); - allowCommands = (List) configFile.getList("settings.restrictions.allowCommands"); + allowCommands = configFile.getStringList("settings.restrictions.allowCommands"); if (configFile.contains("allowCommands")) { if (!allowCommands.contains("/login")) allowCommands.add("/login"); @@ -210,7 +209,7 @@ public final class Settings extends YamlConfiguration { getmailSMTP = configFile.getString("Email.mailSMTP", "smtp.gmail.com"); getMailPort = configFile.getInt("Email.mailPort", 465); getRecoveryPassLength = configFile.getInt("Email.RecoveryPasswordLength", 8); - getMySQLOtherUsernameColumn = (List) configFile.getList("ExternalBoardOptions.mySQLOtherUsernameColumns", new ArrayList()); + getMySQLOtherUsernameColumn = configFile.getStringList("ExternalBoardOptions.mySQLOtherUsernameColumns"); displayOtherAccounts = configFile.getBoolean("settings.restrictions.displayOtherAccounts", true); getMySQLColumnId = configFile.getString("DataSource.mySQLColumnId", "id"); getmailSenderName = configFile.getString("Email.mailSenderName", ""); @@ -274,7 +273,7 @@ public final class Settings extends YamlConfiguration { emailBlacklist = configFile.getStringList("Email.emailBlacklisted"); emailWhitelist = configFile.getStringList("Email.emailWhitelisted"); forceRegisterCommands = configFile.getStringList("settings.forceRegisterCommands"); - forceRegisterCommandsAsConsole = (List) configFile.getList("settings.forceRegisterCommandsAsConsole", new ArrayList()); + forceRegisterCommandsAsConsole = configFile.getStringList("settings.forceRegisterCommandsAsConsole"); customAttributes = configFile.getBoolean("Hooks.customAttributes"); generateImage = configFile.getBoolean("Email.generateImage", true); @@ -289,7 +288,8 @@ public final class Settings extends YamlConfiguration { set("Xenoforo.predefinedSalt", null); changes = true; } - if (configFile.getString("settings.security.passwordHash", "SHA256").toUpperCase().equals("XFSHA1") || configFile.getString("settings.security.passwordHash", "SHA256").toUpperCase().equals("XFSHA256")) { + if (configFile.getString("settings.security.passwordHash", "SHA256").toUpperCase().equals("XFSHA1") || + configFile.getString("settings.security.passwordHash", "SHA256").toUpperCase().equals("XFSHA256")) { set("settings.security.passwordHash", "XENFORO"); changes = true; } @@ -462,7 +462,7 @@ public final class Settings extends YamlConfiguration { changes = true; } if (contains("Hooks.chestshop")) { - if(getBoolean("Hooks.chestshop")) { + if (getBoolean("Hooks.chestshop")) { set("Hooks.legacyChestshop", true); } set("Hooks.chestshop", null);