diff options
author | Petr Ilin <hevav@hevav.dev> | 2022-04-01 18:50:56 +0300 |
---|---|---|
committer | Petr Ilin <hevav@hevav.dev> | 2022-04-01 18:50:56 +0300 |
commit | 757ab79b96b0b6d784fa113a496f56e52f59c88a (patch) | |
tree | b58432ee9e7196cdf2dc5bda2a009aaa39b34b32 | |
parent | 55466d561ce8f64ae0fb5629b7a3d013d65bb76e (diff) | |
download | LimboAuth-757ab79b96b0b6d784fa113a496f56e52f59c88a.tar.gz LimboAuth-757ab79b96b0b6d784fa113a496f56e52f59c88a.tar.bz2 LimboAuth-757ab79b96b0b6d784fa113a496f56e52f59c88a.zip |
Floodgate nicknames fix
-rw-r--r-- | src/main/java/net/elytrium/limboauth/LimboAuth.java | 6 |
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; } |