From 757ab79b96b0b6d784fa113a496f56e52f59c88a Mon Sep 17 00:00:00 2001 From: Petr Ilin Date: Fri, 1 Apr 2022 18:50:56 +0300 Subject: Floodgate nicknames fix --- src/main/java/net/elytrium/limboauth/LimboAuth.java | 6 ++---- 1 file 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; } -- cgit