From 7f8f63e02c38bc0db4f697b79b4b64442860b967 Mon Sep 17 00:00:00 2001 From: Aldin Date: Wed, 13 Mar 2024 18:10:20 +0100 Subject: [PATCH] fix: make the player kick command reason quoted to allow flags (#1374) ### Motivation Cloud does not parse flags provided after a greedy string argument. This results in the --force flag of the players kick command being useless. ### Modification The reason for the kick is now provided as quoted string and the flag is parsed correctly. ### Result The force kick flag is usable. --- .../modules/bridge/node/command/PlayersCommand.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/bridge/src/main/java/eu/cloudnetservice/modules/bridge/node/command/PlayersCommand.java b/modules/bridge/src/main/java/eu/cloudnetservice/modules/bridge/node/command/PlayersCommand.java index e7bcd4c342..a59bcd82c3 100644 --- a/modules/bridge/src/main/java/eu/cloudnetservice/modules/bridge/node/command/PlayersCommand.java +++ b/modules/bridge/src/main/java/eu/cloudnetservice/modules/bridge/node/command/PlayersCommand.java @@ -22,6 +22,7 @@ import cloud.commandframework.annotations.Flag; import cloud.commandframework.annotations.parsers.Parser; import cloud.commandframework.annotations.specifier.Greedy; +import cloud.commandframework.annotations.specifier.Quoted; import cloud.commandframework.annotations.suggestions.Suggestions; import cloud.commandframework.context.CommandContext; import eu.cloudnetservice.common.Named; @@ -217,7 +218,7 @@ public void deletePlayer( public void kickPlayer( @NonNull CommandSource source, @NonNull @Argument("player") CloudPlayer player, - @Nullable @Greedy @Argument("reason") String reason, + @Nullable @Quoted @Argument("reason") String reason, @Flag("force") boolean force ) { var reasonComponent = reason == null