aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java')
-rw-r--r--src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java b/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java
index c2a0234..6a65e7f 100644
--- a/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java
+++ b/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java
@@ -44,6 +44,7 @@ import net.elytrium.limboauth.event.PostRegisterEvent;
import net.elytrium.limboauth.event.TaskEvent;
import net.elytrium.limboauth.migration.MigrationHash;
import net.elytrium.limboauth.model.RegisteredPlayer;
+import net.kyori.adventure.audience.MessageType;
import net.kyori.adventure.bossbar.BossBar;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.title.Title;
@@ -204,7 +205,7 @@ public class AuthSessionHandler implements LimboSessionHandler {
this.proxyPlayer.disconnect(databaseErrorKick);
}
- this.proxyPlayer.sendMessage(registerSuccessful);
+ this.proxyPlayer.sendMessage(registerSuccessful, MessageType.SYSTEM);
if (registerSuccessfulTitle != null) {
this.proxyPlayer.showTitle(registerSuccessfulTitle);
}
@@ -228,7 +229,7 @@ public class AuthSessionHandler implements LimboSessionHandler {
this.sendMessage(true);
}
} else if (--this.attempts != 0) {
- this.proxyPlayer.sendMessage(loginWrongPassword[this.attempts - 1]);
+ this.proxyPlayer.sendMessage(loginWrongPassword[this.attempts - 1], MessageType.SYSTEM);
} else {
this.proxyPlayer.disconnect(loginWrongPasswordKick);
}
@@ -256,17 +257,17 @@ public class AuthSessionHandler implements LimboSessionHandler {
private void sendMessage(boolean sendTitle) {
if (this.totpState) {
- this.proxyPlayer.sendMessage(totp);
+ this.proxyPlayer.sendMessage(totp, MessageType.SYSTEM);
if (sendTitle && totpTitle != null) {
this.proxyPlayer.showTitle(totpTitle);
}
} else if (this.playerInfo == null) {
- this.proxyPlayer.sendMessage(register);
+ this.proxyPlayer.sendMessage(register, MessageType.SYSTEM);
if (sendTitle && registerTitle != null) {
this.proxyPlayer.showTitle(registerTitle);
}
} else {
- this.proxyPlayer.sendMessage(login[this.attempts - 1]);
+ this.proxyPlayer.sendMessage(login[this.attempts - 1], MessageType.SYSTEM);
if (sendTitle && loginTitle != null) {
this.proxyPlayer.showTitle(loginTitle);
}
@@ -285,7 +286,7 @@ public class AuthSessionHandler implements LimboSessionHandler {
if (!Settings.IMP.MAIN.REGISTER_NEED_REPEAT_PASSWORD || args[1].equals(args[2])) {
return true;
} else {
- this.proxyPlayer.sendMessage(registerDifferentPasswords);
+ this.proxyPlayer.sendMessage(registerDifferentPasswords, MessageType.SYSTEM);
return false;
}
}
@@ -293,10 +294,10 @@ public class AuthSessionHandler implements LimboSessionHandler {
private boolean checkPasswordLength(String password) {
int length = password.length();
if (length > Settings.IMP.MAIN.MAX_PASSWORD_LENGTH) {
- this.proxyPlayer.sendMessage(registerPasswordTooLong);
+ this.proxyPlayer.sendMessage(registerPasswordTooLong, MessageType.SYSTEM);
return false;
} else if (length < Settings.IMP.MAIN.MIN_PASSWORD_LENGTH) {
- this.proxyPlayer.sendMessage(registerPasswordTooShort);
+ this.proxyPlayer.sendMessage(registerPasswordTooShort, MessageType.SYSTEM);
return false;
} else {
return true;
@@ -305,7 +306,7 @@ public class AuthSessionHandler implements LimboSessionHandler {
private boolean checkPasswordStrength(String password) {
if (Settings.IMP.MAIN.CHECK_PASSWORD_STRENGTH && this.plugin.getUnsafePasswords().contains(password)) {
- this.proxyPlayer.sendMessage(registerPasswordUnsafe);
+ this.proxyPlayer.sendMessage(registerPasswordUnsafe, MessageType.SYSTEM);
return false;
} else {
return true;
@@ -313,7 +314,7 @@ public class AuthSessionHandler implements LimboSessionHandler {
}
private void finishLogin() {
- this.proxyPlayer.sendMessage(loginSuccessful);
+ this.proxyPlayer.sendMessage(loginSuccessful, MessageType.SYSTEM);
if (loginSuccessfulTitle != null) {
this.proxyPlayer.showTitle(loginSuccessfulTitle);
}