Add String[] args

This commit is contained in:
Alexander Söderberg 2020-10-09 20:44:17 +02:00
parent 16623969ad
commit fcd269b6e7
No known key found for this signature in database
GPG key ID: FACEA5B0F4C1BF80
7 changed files with 176 additions and 0 deletions

View file

@ -38,6 +38,7 @@ import cloud.commandframework.arguments.standard.FloatArgument;
import cloud.commandframework.arguments.standard.IntegerArgument;
import cloud.commandframework.arguments.standard.ShortArgument;
import cloud.commandframework.arguments.standard.StringArgument;
import cloud.commandframework.arguments.standard.StringArrayArgument;
import cloud.commandframework.context.CommandContext;
import cloud.commandframework.permission.CommandPermission;
import cloud.commandframework.permission.Permission;
@ -185,6 +186,9 @@ public final class CloudBrigadierManager<C, S> {
/* Map flags to a greedy string */
this.registerMapping(new TypeToken<FlagArgument.FlagArgumentParser<C>>() {
}, false, argument -> StringArgumentType.greedyString());
/* Map String[] to a greedy string */
this.registerMapping(new TypeToken<StringArrayArgument.StringArrayParser<C>>() {
}, false, argument -> StringArgumentType.greedyString());
}
/**