Use default descriptions and others

This commit is contained in:
broccolai 2021-04-20 23:26:16 +01:00 committed by Jason
parent 677ba4d0e9
commit 2a4c29267c
35 changed files with 319 additions and 96 deletions

View file

@ -56,6 +56,7 @@ public final class PlayerArgument<C> extends CommandArgument<C, ProxiedPlayer> {
private PlayerArgument(
final boolean required,
final @NonNull String name,
final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionProvider,
final @NonNull ArgumentDescription defaultDescription,
final @NonNull Collection<@NonNull BiFunction<@NonNull CommandContext<C>, @NonNull Queue<@NonNull String>,
@ -65,7 +66,7 @@ public final class PlayerArgument<C> extends CommandArgument<C, ProxiedPlayer> {
required,
name,
new PlayerParser<>(),
"",
defaultValue,
TypeToken.get(ProxiedPlayer.class),
suggestionProvider,
defaultDescription,
@ -130,6 +131,7 @@ public final class PlayerArgument<C> extends CommandArgument<C, ProxiedPlayer> {
return new PlayerArgument<>(
this.isRequired(),
this.getName(),
this.getDefaultValue(),
this.getSuggestionsProvider(),
this.getDefaultDescription(),
new LinkedList<>()

View file

@ -56,6 +56,7 @@ public final class ServerArgument<C> extends CommandArgument<C, ServerInfo> {
private ServerArgument(
final boolean required,
final @NonNull String name,
final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription,
final @NonNull Collection<@NonNull BiFunction<@NonNull CommandContext<C>, @NonNull Queue<@NonNull String>,
@ -65,7 +66,7 @@ public final class ServerArgument<C> extends CommandArgument<C, ServerInfo> {
required,
name,
new ServerParser<>(),
"",
defaultValue,
TypeToken.get(ServerInfo.class),
suggestionsProvider,
defaultDescription,
@ -129,6 +130,7 @@ public final class ServerArgument<C> extends CommandArgument<C, ServerInfo> {
return new ServerArgument<>(
this.isRequired(),
this.getName(),
this.getDefaultValue(),
this.getSuggestionsProvider(),
this.getDefaultDescription(),
new LinkedList<>()