mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2025-03-02 10:41:43 +01:00
Fix yet another build
This commit is contained in:
parent
9b7139a17a
commit
bc4cb5046d
@ -49,9 +49,9 @@ class LimboPlayerTaskManager {
|
||||
*/
|
||||
void registerMessageTask(Player player, LimboPlayer limbo, boolean isRegistered) {
|
||||
int interval = settings.getProperty(RegistrationSettings.MESSAGE_INTERVAL);
|
||||
MessageResult messageResult = getMessageKey(player.getName(), isRegistered);
|
||||
MessageResult result = getMessageKey(player.getName(), isRegistered);
|
||||
if (interval > 0) {
|
||||
String[] joinMessage = messages.retrieveSingle(messageResult.messageKey, player, messageResult.args).split("\n");
|
||||
String[] joinMessage = messages.retrieveSingle(result.messageKey, player, result.args).split("\n");
|
||||
MessageTask messageTask = new MessageTask(player, joinMessage);
|
||||
bukkitService.runTaskTimer(messageTask, 2 * TICKS_PER_SECOND, interval * TICKS_PER_SECOND);
|
||||
limbo.setMessageTask(messageTask);
|
||||
|
@ -116,7 +116,7 @@ public class Messages {
|
||||
* @return The message from the file
|
||||
*/
|
||||
private String retrieveMessage(MessageKey key, CommandSender sender) {
|
||||
String message = messagesFileHandler.getMessage(key.getKey());
|
||||
String message = messagesFileHandler.getMessage(key.getKey());
|
||||
String displayName = sender.getName();
|
||||
if (sender instanceof Player) {
|
||||
displayName = ((Player) sender).getDisplayName();
|
||||
|
@ -64,6 +64,7 @@ public class CommonService {
|
||||
* Retrieves a message in one piece.
|
||||
*
|
||||
* @param key the key of the message
|
||||
* @param sender The entity to send the message to
|
||||
* @return the message
|
||||
*/
|
||||
public String retrieveSingleMessage(MessageKey key, CommandSender sender) {
|
||||
|
@ -141,6 +141,7 @@ public class MessagesIntegrationTest {
|
||||
MessageKey key = MessageKey.LOGIN_SUCCESS;
|
||||
Player player = Mockito.mock(Player.class);
|
||||
given(player.getName()).willReturn("Tester");
|
||||
given(player.getDisplayName()).willReturn("§cTesty");
|
||||
|
||||
// when
|
||||
messages.send(player, key);
|
||||
@ -155,6 +156,7 @@ public class MessagesIntegrationTest {
|
||||
MessageKey key = MessageKey.UNKNOWN_USER;
|
||||
Player player = Mockito.mock(Player.class);
|
||||
given(player.getName()).willReturn("Tester");
|
||||
given(player.getDisplayName()).willReturn("§cTesty");
|
||||
|
||||
// when
|
||||
messages.send(player, key);
|
||||
@ -172,12 +174,13 @@ public class MessagesIntegrationTest {
|
||||
MessageKey key = MessageKey.REGISTER_MESSAGE;
|
||||
Player player = Mockito.mock(Player.class);
|
||||
given(player.getName()).willReturn("Tester");
|
||||
given(player.getDisplayName()).willReturn("§cTesty");
|
||||
|
||||
// when
|
||||
messages.send(player, key);
|
||||
|
||||
// then
|
||||
verify(player).sendMessage("§3Please Tester, register to the server with the command: /register <password> <ConfirmPassword>");
|
||||
verify(player).sendMessage("§3Please Tester, register to the §cTesty§3.");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -3,7 +3,7 @@
|
||||
error:
|
||||
unregistered_user: 'We''ve got%nl%new lines%nl%and '' apostrophes'
|
||||
registration:
|
||||
register_request: '&3Please %username%, register to the server with the command: /register <password> <ConfirmPassword>'
|
||||
register_request: '&3Please %username%, register to the %displayname%&3.'
|
||||
login:
|
||||
success: '&cHere we have&bdefined some colors &dand some other <hings'
|
||||
wrong_password: '&cWrong password!'
|
||||
|
Loading…
Reference in New Issue
Block a user