aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/net/elytrium
diff options
context:
space:
mode:
authorPetr Ilin <hevav@hevav.dev>2022-04-01 18:50:56 +0300
committerPetr Ilin <hevav@hevav.dev>2022-04-01 18:50:56 +0300
commit757ab79b96b0b6d784fa113a496f56e52f59c88a (patch)
treeb58432ee9e7196cdf2dc5bda2a009aaa39b34b32 /src/main/java/net/elytrium
parent55466d561ce8f64ae0fb5629b7a3d013d65bb76e (diff)
downloadLimboAuth-757ab79b96b0b6d784fa113a496f56e52f59c88a.tar.gz
LimboAuth-757ab79b96b0b6d784fa113a496f56e52f59c88a.tar.bz2
LimboAuth-757ab79b96b0b6d784fa113a496f56e52f59c88a.zip
Floodgate nicknames fix
Diffstat (limited to 'src/main/java/net/elytrium')
-rw-r--r--src/main/java/net/elytrium/limboauth/LimboAuth.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/main/java/net/elytrium/limboauth/LimboAuth.java b/src/main/java/net/elytrium/limboauth/LimboAuth.java
index 7feb670..b92ec91 100644
--- a/src/main/java/net/elytrium/limboauth/LimboAuth.java
+++ b/src/main/java/net/elytrium/limboauth/LimboAuth.java
@@ -375,11 +375,9 @@ public class LimboAuth {
String nickname = player.getUsername();
boolean isFloodgate = !Settings.IMP.MAIN.FLOODGATE_NEED_AUTH && this.floodgateApi.isFloodgatePlayer(player.getUniqueId());
- if (isFloodgate) {
- nickname = nickname.substring(this.floodgateApi.getPrefixLength());
- }
+ String validatorNickname = (isFloodgate) ? nickname.substring(this.floodgateApi.getPrefixLength()) : nickname;
- if (!this.nicknameValidationPattern.matcher(nickname).matches()) {
+ if (!this.nicknameValidationPattern.matcher(validatorNickname).matches()) {
player.disconnect(LegacyComponentSerializer.legacyAmpersand().deserialize(Settings.IMP.MAIN.STRINGS.NICKNAME_INVALID_KICK));
return;
}