aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authormdxd44 <ogurec332@mail.ru>2022-01-12 18:56:56 +0900
committermdxd44 <ogurec332@mail.ru>2022-01-12 18:57:21 +0900
commitaac95697695c63ddd21ae59ce4b9db932a88e8cf (patch)
treec04abd2882a70d192e2b9247eecfd3f501b9207a /src/main/java
parentb71456c9e1048b02ffc09b29ebaf704061148beb (diff)
downloadLimboAuth-aac95697695c63ddd21ae59ce4b9db932a88e8cf.tar.gz
LimboAuth-aac95697695c63ddd21ae59ce4b9db932a88e8cf.tar.bz2
LimboAuth-aac95697695c63ddd21ae59ce4b9db932a88e8cf.zip
[ci skip] Fix README.md.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/net/elytrium/limboauth/LimboAuth.java6
-rw-r--r--src/main/java/net/elytrium/limboauth/command/LimboAuthCommand.java6
2 files changed, 3 insertions, 9 deletions
diff --git a/src/main/java/net/elytrium/limboauth/LimboAuth.java b/src/main/java/net/elytrium/limboauth/LimboAuth.java
index 6ba887d..ad54496 100644
--- a/src/main/java/net/elytrium/limboauth/LimboAuth.java
+++ b/src/main/java/net/elytrium/limboauth/LimboAuth.java
@@ -77,7 +77,6 @@ import net.elytrium.limboauth.handler.AuthSessionHandler;
import net.elytrium.limboauth.listener.AuthListener;
import net.elytrium.limboauth.model.RegisteredPlayer;
import net.elytrium.limboauth.utils.UpdatesChecker;
-import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import net.kyori.adventure.title.Title;
import org.bstats.velocity.Metrics;
@@ -114,7 +113,6 @@ public class LimboAuth {
private Dao<RegisteredPlayer, String> playerDao;
private Pattern nicknameValidationPattern;
private Limbo authServer;
- private Component nicknameInvalid;
@Inject
public LimboAuth(ProxyServer server, Logger logger, Metrics.Factory metricsFactory, @DataDirectory Path dataDirectory) {
@@ -253,8 +251,6 @@ public class LimboAuth {
this.authServer = this.factory.createLimbo(authWorld);
- this.nicknameInvalid = LegacyComponentSerializer.legacyAmpersand().deserialize(Settings.IMP.MAIN.STRINGS.NICKNAME_INVALID_KICK);
-
this.server.getEventManager().unregisterListeners(this);
this.server.getEventManager().register(this, new AuthListener(this, this.playerDao));
@@ -337,7 +333,7 @@ public class LimboAuth {
public void authPlayer(Player player) {
String nickname = player.getUsername();
if (!this.nicknameValidationPattern.matcher(nickname).matches()) {
- player.disconnect(this.nicknameInvalid);
+ player.disconnect(LegacyComponentSerializer.legacyAmpersand().deserialize(Settings.IMP.MAIN.STRINGS.NICKNAME_INVALID_KICK));
return;
}
diff --git a/src/main/java/net/elytrium/limboauth/command/LimboAuthCommand.java b/src/main/java/net/elytrium/limboauth/command/LimboAuthCommand.java
index 1465023..73c6faf 100644
--- a/src/main/java/net/elytrium/limboauth/command/LimboAuthCommand.java
+++ b/src/main/java/net/elytrium/limboauth/command/LimboAuthCommand.java
@@ -69,11 +69,9 @@ public class LimboAuthCommand implements SimpleCommand {
source.sendMessage(LegacyComponentSerializer.legacyAmpersand().deserialize(Settings.IMP.MAIN.STRINGS.RELOAD_FAILED));
e.printStackTrace();
}
- } else {
- this.showHelp(source);
- }
- return;
+ return;
+ }
}
this.showHelp(source);