aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorAVuTuVA <66278054+AVuTuVA@users.noreply.github.com>2023-01-22 13:15:42 +0300
committerGitHub <noreply@github.com>2023-01-22 13:15:42 +0300
commit4f688dce7f7ab9d66ea6136351a5b59fe17a2236 (patch)
tree091600fc85fd9101489d83616205b6c3276b4db8 /src/main/java
parent0cacf83f84c88d018670c508a6d886166bd8af83 (diff)
downloadLimboAuth-4f688dce7f7ab9d66ea6136351a5b59fe17a2236.tar.gz
LimboAuth-4f688dce7f7ab9d66ea6136351a5b59fe17a2236.tar.bz2
LimboAuth-4f688dce7f7ab9d66ea6136351a5b59fe17a2236.zip
Don't register command if totp is disabled (#74)
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/net/elytrium/limboauth/LimboAuth.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/net/elytrium/limboauth/LimboAuth.java b/src/main/java/net/elytrium/limboauth/LimboAuth.java
index 0e88e2f..49bc15b 100644
--- a/src/main/java/net/elytrium/limboauth/LimboAuth.java
+++ b/src/main/java/net/elytrium/limboauth/LimboAuth.java
@@ -385,8 +385,11 @@ public class LimboAuth {
.setWorldTime(Settings.IMP.MAIN.WORLD_TICKS)
.setGameMode(Settings.IMP.MAIN.GAME_MODE)
.registerCommand(new LimboCommandMeta(this.filterCommands(Settings.IMP.MAIN.REGISTER_COMMAND)))
- .registerCommand(new LimboCommandMeta(this.filterCommands(Settings.IMP.MAIN.LOGIN_COMMAND)))
- .registerCommand(new LimboCommandMeta(this.filterCommands(Settings.IMP.MAIN.TOTP_COMMAND)));
+ .registerCommand(new LimboCommandMeta(this.filterCommands(Settings.IMP.MAIN.LOGIN_COMMAND)));
+
+ if (Settings.IMP.MAIN.ENABLE_TOTP) {
+ this.authServer.registerCommand(new LimboCommandMeta(this.filterCommands(Settings.IMP.MAIN.TOTP_COMMAND)));
+ }
EventManager eventManager = this.server.getEventManager();
eventManager.unregisterListeners(this);