Skip to content

Commit

Permalink
fix(velocity): fallback to "" commandAlias on CommandExecuteEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
Apehum committed Nov 3, 2024
1 parent 59f67fe commit d49dd7c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ class VelocityCommandManager(
@Subscribe
fun onCommandExecute(event: CommandExecuteEvent) {
val command = event.command
val commandAlias = command.split(" ".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()[0]
val commandAlias = command.split(" ")
.dropLastWhile { it.isEmpty() }
.getOrNull(0) ?: ""

val commandSource = getCommandSource(event.commandSource)
McProxyCommandExecuteEvent.invoker.onCommandExecute(commandSource, command)
Expand Down

0 comments on commit d49dd7c

Please sign in to comment.