diff --git a/src/main/java/fr/xephi/authme/AuthMe.java b/src/main/java/fr/xephi/authme/AuthMe.java index 3018fd0fa..775b22aa2 100644 --- a/src/main/java/fr/xephi/authme/AuthMe.java +++ b/src/main/java/fr/xephi/authme/AuthMe.java @@ -17,6 +17,8 @@ import fr.xephi.authme.hooks.BungeeCordMessage; import fr.xephi.authme.hooks.EssSpawn; import fr.xephi.authme.listener.*; import fr.xephi.authme.modules.ModuleManager; +import fr.xephi.authme.output.ConsoleFilter; +import fr.xephi.authme.output.Log4JFilter; import fr.xephi.authme.output.MessageKey; import fr.xephi.authme.output.Messages; import fr.xephi.authme.permission.PermissionsManager; diff --git a/src/main/java/fr/xephi/authme/ConsoleFilter.java b/src/main/java/fr/xephi/authme/output/ConsoleFilter.java similarity index 81% rename from src/main/java/fr/xephi/authme/ConsoleFilter.java rename to src/main/java/fr/xephi/authme/output/ConsoleFilter.java index 7e12ef10e..be1c6bec7 100644 --- a/src/main/java/fr/xephi/authme/ConsoleFilter.java +++ b/src/main/java/fr/xephi/authme/output/ConsoleFilter.java @@ -1,4 +1,4 @@ -package fr.xephi.authme; +package fr.xephi.authme.output; import java.util.logging.Filter; import java.util.logging.LogRecord; @@ -7,20 +7,9 @@ import java.util.logging.LogRecord; * Console filter Class * * @author Xephi59 - * @version $Revision: 1.0 $ */ public class ConsoleFilter implements Filter { - public ConsoleFilter() { - } - - /** - * Method isLoggable. - * - * @param record LogRecord - * - * @return boolean * @see java.util.logging.Filter#isLoggable(LogRecord) - */ @Override public boolean isLoggable(LogRecord record) { try { diff --git a/src/main/java/fr/xephi/authme/Log4JFilter.java b/src/main/java/fr/xephi/authme/output/Log4JFilter.java similarity index 98% rename from src/main/java/fr/xephi/authme/Log4JFilter.java rename to src/main/java/fr/xephi/authme/output/Log4JFilter.java index 581699f08..aa43beed1 100644 --- a/src/main/java/fr/xephi/authme/Log4JFilter.java +++ b/src/main/java/fr/xephi/authme/output/Log4JFilter.java @@ -1,4 +1,4 @@ -package fr.xephi.authme; +package fr.xephi.authme.output; import fr.xephi.authme.util.StringUtils; import org.apache.logging.log4j.Level; @@ -11,7 +11,6 @@ import org.apache.logging.log4j.message.Message; * Implements a filter for Log4j to skip sensitive AuthMe commands. * * @author Xephi59 - * @version $Revision: 1.0 $ */ public class Log4JFilter implements org.apache.logging.log4j.core.Filter { diff --git a/src/main/java/fr/xephi/authme/output/Messages.java b/src/main/java/fr/xephi/authme/output/Messages.java index 44930ba48..ad586fd12 100644 --- a/src/main/java/fr/xephi/authme/output/Messages.java +++ b/src/main/java/fr/xephi/authme/output/Messages.java @@ -6,6 +6,8 @@ import org.bukkit.command.CommandSender; /** * Class for retrieving and sending translatable messages to players. + * This class detects when the language settings have changed and will + * automatically update to use a new language file. */ public class Messages { @@ -19,6 +21,11 @@ public class Messages { this.manager = manager; } + /** + * Get the instance of Messages. + * + * @return The Messages instance + */ public static Messages getInstance() { if (singleton == null) { MessagesManager manager = new MessagesManager(Settings.messageFile); @@ -65,6 +72,9 @@ public class Messages { return StringUtils.join("\n", retrieve(key)); } + /** + * Reload the messages manager. + */ public void reloadManager() { manager = new MessagesManager(Settings.messageFile); } diff --git a/src/main/java/fr/xephi/authme/output/MessagesManager.java b/src/main/java/fr/xephi/authme/output/MessagesManager.java index 0a973b908..3221e334f 100644 --- a/src/main/java/fr/xephi/authme/output/MessagesManager.java +++ b/src/main/java/fr/xephi/authme/output/MessagesManager.java @@ -6,7 +6,10 @@ import fr.xephi.authme.settings.CustomConfiguration; import java.io.File; /** - * Class for retrieving and sending translatable messages to players. + * Class responsible for reading messages from a file and formatting them for Minecraft. + *
+ * This class is used within {@link Messages}, which offers a high-level interface for accessing + * or sending messages from a properties file. */ class MessagesManager extends CustomConfiguration { diff --git a/src/test/java/fr/xephi/authme/Log4JFilterTest.java b/src/test/java/fr/xephi/authme/output/Log4JFilterTest.java similarity index 98% rename from src/test/java/fr/xephi/authme/Log4JFilterTest.java rename to src/test/java/fr/xephi/authme/output/Log4JFilterTest.java index f8d185d34..fdd338919 100644 --- a/src/test/java/fr/xephi/authme/Log4JFilterTest.java +++ b/src/test/java/fr/xephi/authme/output/Log4JFilterTest.java @@ -1,4 +1,4 @@ -package fr.xephi.authme; +package fr.xephi.authme.output; import static org.hamcrest.Matchers.equalTo; import static org.junit.Assert.assertThat; @@ -12,8 +12,6 @@ import org.mockito.Mockito; /** * Test for {@link Log4JFilter}. - * @author Gabriele - * @version $Revision: 1.0 $ */ public class Log4JFilterTest { diff --git a/src/test/java/fr/xephi/authme/permission/PlayerPermissionTest.java b/src/test/java/fr/xephi/authme/permission/PlayerPermissionTest.java index 81893373f..6afc0ac07 100644 --- a/src/test/java/fr/xephi/authme/permission/PlayerPermissionTest.java +++ b/src/test/java/fr/xephi/authme/permission/PlayerPermissionTest.java @@ -20,7 +20,8 @@ public class PlayerPermissionTest { // when/then for (PlayerPermission permission : PlayerPermission.values()) { if (!permission.getNode().startsWith(requiredPrefix)) { - fail("The permission '" + permission + "' does not start with the required prefix '" + requiredPrefix + "'"); + fail("The permission '" + permission + "' does not start with the required prefix '" + requiredPrefix + + "'"); } } }