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, Player> {
private PlayerArgument(
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 PlayerArgument<C> extends CommandArgument<C, Player> {
required,
name,
new PlayerParser<>(),
"",
defaultValue,
TypeToken.get(Player.class),
suggestionsProvider,
defaultDescription,
@ -128,6 +129,7 @@ public final class PlayerArgument<C> extends CommandArgument<C, Player> {
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, RegisteredServer
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, RegisteredServer
required,
name,
new ServerParser<>(),
"",
defaultValue,
TypeToken.get(RegisteredServer.class),
suggestionsProvider,
defaultDescription,
@ -125,6 +126,7 @@ public final class ServerArgument<C> extends CommandArgument<C, RegisteredServer
return new ServerArgument<>(
this.isRequired(),
this.getName(),
this.getDefaultValue(),
this.getSuggestionsProvider(),
this.getDefaultDescription(),
new LinkedList<>()