diff --git a/src/main/java/fr/xephi/authme/settings/CustomConfiguration.java b/src/main/java/fr/xephi/authme/settings/CustomConfiguration.java index bb4703591..15e651aa5 100644 --- a/src/main/java/fr/xephi/authme/settings/CustomConfiguration.java +++ b/src/main/java/fr/xephi/authme/settings/CustomConfiguration.java @@ -15,13 +15,13 @@ import fr.xephi.authme.ConsoleLogger; /** */ -public class CustomConfiguration extends YamlConfiguration { +public abstract class CustomConfiguration extends YamlConfiguration { private File configFile; /** * Constructor for CustomConfiguration. - * @param file File + * @param file the config file */ public CustomConfiguration(File file) { this.configFile = file; @@ -41,10 +41,6 @@ public class CustomConfiguration extends YamlConfiguration { } } - /** - * Method reLoad. - - * @return boolean */ public boolean reLoad() { boolean out = true; if (!configFile.exists()) { @@ -63,20 +59,11 @@ public class CustomConfiguration extends YamlConfiguration { } } - /** - * Method getConfigFile. - - * @return File */ public File getConfigFile() { return configFile; } - /** - * Method loadResource. - * @param file File - - * @return boolean */ - public boolean loadResource(File file) { + private boolean loadResource(File file) { if (!file.exists()) { try { if (!file.getParentFile().exists() && !file.getParentFile().mkdirs()) { diff --git a/src/main/java/fr/xephi/authme/settings/Messages.java b/src/main/java/fr/xephi/authme/settings/Messages.java index 46957da61..15b10c4d5 100644 --- a/src/main/java/fr/xephi/authme/settings/Messages.java +++ b/src/main/java/fr/xephi/authme/settings/Messages.java @@ -15,8 +15,8 @@ public class Messages extends CustomConfiguration { /** * Constructor for Messages. - * @param file File - * @param lang String + * @param file the configuration file + * @param lang the code of the language to use */ public Messages(File file, String lang) { super(file); @@ -25,14 +25,10 @@ public class Messages extends CustomConfiguration { this.lang = lang; } - /** - * Method send. - * @param sender CommandSender - * @param msg String - */ public void send(CommandSender sender, String msg) { - if (!Settings.messagesLanguage.equalsIgnoreCase(singleton.lang)) + if (!Settings.messagesLanguage.equalsIgnoreCase(singleton.lang)) { singleton.reloadMessages(); + } String loc = (String) singleton.get(msg); if (loc == null) { loc = "Error with Translation files, please contact the admin for verify or update translation"; @@ -43,11 +39,6 @@ public class Messages extends CustomConfiguration { } } - /** - * Method send. - * @param msg String - - * @return String[] */ public String[] send(String msg) { if (!Settings.messagesLanguage.equalsIgnoreCase(singleton.lang)) { singleton.reloadMessages(); @@ -71,10 +62,6 @@ public class Messages extends CustomConfiguration { return loc; } - /** - * Method getInstance. - - * @return Messages */ public static Messages getInstance() { if (singleton == null) { singleton = new Messages(Settings.messageFile, Settings.messagesLanguage); diff --git a/src/main/resources/messages/messages_en.yml b/src/main/resources/messages/messages_en.yml index 16218f329..dd191d24c 100644 --- a/src/main/resources/messages/messages_en.yml +++ b/src/main/resources/messages/messages_en.yml @@ -52,7 +52,7 @@ email_added: '&2Email address successfully added to your account!' email_confirm: '&cPlease confirm your email address!' email_changed: '&2Email address changed correctly!' email_send: '&2Recovery email sent correctly! Check your email inbox!' -email_exists: '&cA recovery email was already sent! You can discart it and send a new one using the command below:' +email_exists: '&cA recovery email was already sent! You can discard it and send a new one using the command below:' country_banned: '&4Your country is banned from this server!' antibot_auto_enabled: '&4[AntiBotService] AntiBot enabled due to the huge number of connections!' antibot_auto_disabled: '&2[AntiBotService] AntiBot disabled disabled after %m minutes!'