aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
index 268d0234d..cc8754d49 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
+++ b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
@@ -422,6 +422,9 @@ object Commands {
}
private fun registerCommand(name: String, description: String, function: (Array<String>) -> Unit) {
+ if (commands.any { it.name.equals(name, ignoreCase = true) }) {
+ error("The command '$name is already registered!'")
+ }
ClientCommandHandler.instance.registerCommand(SimpleCommand(name, createCommand(function)))
commands.add(CommandInfo(name, description, currentCategory))
}