Skip to content

Commit

Permalink
fix: make the player kick command reason quoted to allow flags (#1374)
Browse files Browse the repository at this point in the history
### 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.
  • Loading branch information
0utplay authored Mar 13, 2024
1 parent 61b081e commit 7f8f63e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7f8f63e

Please sign in to comment.