diff --git a/cloud-core/src/main/java/cloud/commandframework/Command.java b/cloud-core/src/main/java/cloud/commandframework/Command.java index c4ea8ebc..0e076647 100644 --- a/cloud-core/src/main/java/cloud/commandframework/Command.java +++ b/cloud-core/src/main/java/cloud/commandframework/Command.java @@ -573,7 +573,7 @@ public class Command { * @return New builder instance with the command argument inserted into the argument list */ public @NonNull Builder argument(final CommandArgument.@NonNull Builder builder) { - return this.argument(builder.build(), ArgumentDescription.empty()); + return this.argument(builder.build()); } /** @@ -584,7 +584,7 @@ public class Command { * @return New builder instance with the command argument inserted into the argument list */ public @NonNull Builder argument(final @NonNull CommandArgument argument) { - return this.argument(argument, ArgumentDescription.empty()); + return this.argument(argument, argument.getDefaultDescription()); } /** diff --git a/cloud-core/src/main/java/cloud/commandframework/arguments/CommandArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/CommandArgument.java index 2c6850e0..0248a807 100644 --- a/cloud-core/src/main/java/cloud/commandframework/arguments/CommandArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/CommandArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.arguments; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.Command; import cloud.commandframework.CommandManager; import cloud.commandframework.arguments.parser.ArgumentParseResult; @@ -99,6 +100,12 @@ public class CommandArgument implements Comparable>, */ private final Collection, @NonNull Queue<@NonNull String>, @NonNull ArgumentParseResult>> argumentPreprocessors; + + /** + * A description that will be used when registering this argument if no override is provided. + */ + private final ArgumentDescription defaultDescription; + /** * Whether or not the argument has been used before */ @@ -106,6 +113,46 @@ public class CommandArgument implements Comparable>, private Command owningCommand; + /** + * Construct a new command argument + * + * @param required Whether or not the argument is required + * @param name The argument name + * @param parser The argument parser + * @param defaultValue Default value used when no value is provided by the command sender + * @param valueType Type produced by the parser + * @param suggestionsProvider Suggestions provider + * @param defaultDescription Default description to use when registering + * @param argumentPreprocessors Argument preprocessors + * @since 1.4.0 + */ + public CommandArgument( + final boolean required, + final @NonNull String name, + final @NonNull ArgumentParser parser, + final @NonNull String defaultValue, + final @NonNull TypeToken valueType, + final @Nullable BiFunction, String, List> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription, + final @NonNull Collection<@NonNull BiFunction<@NonNull CommandContext, @NonNull Queue<@NonNull String>, + @NonNull ArgumentParseResult>> argumentPreprocessors + ) { + this.required = required; + this.name = Objects.requireNonNull(name, "Name may not be null"); + if (!NAME_PATTERN.asPredicate().test(name)) { + throw new IllegalArgumentException("Name must be alphanumeric"); + } + this.parser = Objects.requireNonNull(parser, "Parser may not be null"); + this.defaultValue = defaultValue; + this.valueType = valueType; + this.suggestionsProvider = suggestionsProvider == null + ? buildDefaultSuggestionsProvider(this) + : suggestionsProvider; + this.defaultDescription = Objects.requireNonNull(defaultDescription, "Default description may not be null"); + this.argumentPreprocessors = new LinkedList<>(argumentPreprocessors); + this.key = SimpleCloudKey.of(this.name, this.valueType); + } + /** * Construct a new command argument * @@ -127,19 +174,16 @@ public class CommandArgument implements Comparable>, final @NonNull Collection<@NonNull BiFunction<@NonNull CommandContext, @NonNull Queue<@NonNull String>, @NonNull ArgumentParseResult>> argumentPreprocessors ) { - this.required = required; - this.name = Objects.requireNonNull(name, "Name may not be null"); - if (!NAME_PATTERN.asPredicate().test(name)) { - throw new IllegalArgumentException("Name must be alphanumeric"); - } - this.parser = Objects.requireNonNull(parser, "Parser may not be null"); - this.defaultValue = defaultValue; - this.valueType = valueType; - this.suggestionsProvider = suggestionsProvider == null - ? buildDefaultSuggestionsProvider(this) - : suggestionsProvider; - this.argumentPreprocessors = new LinkedList<>(argumentPreprocessors); - this.key = SimpleCloudKey.of(this.name, this.valueType); + this( + required, + name, + parser, + defaultValue, + valueType, + suggestionsProvider, + ArgumentDescription.empty(), + argumentPreprocessors + ); } /** @@ -163,6 +207,30 @@ public class CommandArgument implements Comparable>, this(required, name, parser, defaultValue, valueType, suggestionsProvider, Collections.emptyList()); } + /** + * Construct a new command argument + * + * @param required Whether or not the argument is required + * @param name The argument name + * @param parser The argument parser + * @param defaultValue Default value used when no value is provided by the command sender + * @param valueType Type produced by the parser + * @param suggestionsProvider Suggestions provider + * @param defaultDescription Default description to use when registering + * @since 1.4.0 + */ + public CommandArgument( + final boolean required, + final @NonNull String name, + final @NonNull ArgumentParser parser, + final @NonNull String defaultValue, + final @NonNull TypeToken valueType, + final @Nullable BiFunction, String, List> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription + ) { + this(required, name, parser, defaultValue, valueType, suggestionsProvider, defaultDescription, Collections.emptyList()); + } + /** * Construct a new command argument * @@ -185,6 +253,31 @@ public class CommandArgument implements Comparable>, this(required, name, parser, defaultValue, TypeToken.get(valueType), suggestionsProvider); } + /** + * Construct a new command argument + * + * @param required Whether or not the argument is required + * @param name The argument name + * @param parser The argument parser + * @param defaultValue Default value used when no value is provided by the command sender + * @param valueType Type produced by the parser + * @param suggestionsProvider Suggestions provider + * @param defaultDescription Default description to use when registering + * @since 1.4.0 + */ + public CommandArgument( + final boolean required, + final @NonNull String name, + final @NonNull ArgumentParser parser, + final @NonNull String defaultValue, + final @NonNull Class valueType, + final @Nullable BiFunction<@NonNull CommandContext, + @NonNull String, @NonNull List<@NonNull String>> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription + ) { + this(required, name, parser, defaultValue, TypeToken.get(valueType), suggestionsProvider, defaultDescription); + } + /** * Construct a new command argument * @@ -351,6 +444,15 @@ public class CommandArgument implements Comparable>, return this.suggestionsProvider; } + /** + * Get the default description to use when registering and no other is provided. + * + * @return the default description + */ + public final @NonNull ArgumentDescription getDefaultDescription() { + return this.defaultDescription; + } + @Override public final boolean equals(final Object o) { if (this == o) { @@ -429,6 +531,8 @@ public class CommandArgument implements Comparable>, } else { builder = builder.asOptionalWithDefault(this.defaultValue); } + builder = builder.withDefaultDescription(this.defaultDescription); + return builder.build(); } @@ -465,6 +569,7 @@ public class CommandArgument implements Comparable>, private ArgumentParser parser; private String defaultValue = ""; private BiFunction<@NonNull CommandContext, @NonNull String, @NonNull List> suggestionsProvider; + private @NonNull ArgumentDescription defaultDescription = ArgumentDescription.empty(); private final Collection, @NonNull String, @NonNull ArgumentParseResult>> argumentPreprocessors = new LinkedList<>(); @@ -565,6 +670,22 @@ public class CommandArgument implements Comparable>, return this; } + /** + * Set the default description to be used for this argument. + * + *

The default description is used when no other description is provided for a certain argument.

+ * + * @param defaultDescription The default description + * @return Builder instance + * @since 1.4.0 + */ + public @NonNull Builder<@NonNull C, @NonNull T> withDefaultDescription( + final @NonNull ArgumentDescription defaultDescription + ) { + this.defaultDescription = Objects.requireNonNull(defaultDescription, "Default description may not be null"); + return this; + } + /** * Construct a command argument from the builder settings * @@ -588,7 +709,8 @@ public class CommandArgument implements Comparable>, this.parser, this.defaultValue, this.valueType, - this.suggestionsProvider + this.suggestionsProvider, + this.defaultDescription ); } @@ -613,6 +735,10 @@ public class CommandArgument implements Comparable>, return this.suggestionsProvider; } + protected final @NonNull ArgumentDescription getDefaultDescription() { + return this.defaultDescription; + } + } } diff --git a/cloud-core/src/main/java/cloud/commandframework/arguments/standard/BooleanArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/BooleanArgument.java index 414cd1e8..a8cf7f3d 100644 --- a/cloud-core/src/main/java/cloud/commandframework/arguments/standard/BooleanArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/BooleanArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.arguments.standard; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -50,9 +51,10 @@ public final class BooleanArgument extends CommandArgument { final boolean liberal, final @NonNull String defaultValue, final @Nullable BiFunction<@NonNull CommandContext, @NonNull String, - @NonNull List<@NonNull String>> suggestionsProvider + @NonNull List<@NonNull String>> suggestionsProvider, + final @NonNull ArgumentDescription description ) { - super(required, name, new BooleanParser<>(liberal), defaultValue, Boolean.class, suggestionsProvider); + super(required, name, new BooleanParser<>(liberal), defaultValue, Boolean.class, suggestionsProvider, description); this.liberal = liberal; } @@ -110,7 +112,7 @@ public final class BooleanArgument extends CommandArgument { * @return Liberal boolean */ public boolean isLiberal() { - return liberal; + return this.liberal; } public static final class Builder extends CommandArgument.Builder { @@ -144,7 +146,8 @@ public final class BooleanArgument extends CommandArgument { this.getName(), this.liberal, this.getDefaultValue(), - this.getSuggestionsProvider() + this.getSuggestionsProvider(), + this.getDefaultDescription() ); } diff --git a/cloud-core/src/main/java/cloud/commandframework/arguments/standard/ByteArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/ByteArgument.java index f4a2661c..48ac7304 100644 --- a/cloud-core/src/main/java/cloud/commandframework/arguments/standard/ByteArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/ByteArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.arguments.standard; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -49,9 +50,10 @@ public final class ByteArgument extends CommandArgument { final byte max, final @NonNull String defaultValue, final @Nullable BiFunction<@NonNull CommandContext, @NonNull String, - @NonNull List<@NonNull String>> suggestionsProvider + @NonNull List<@NonNull String>> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription ) { - super(required, name, new ByteParser<>(min, max), defaultValue, Byte.class, suggestionsProvider); + super(required, name, new ByteParser<>(min, max), defaultValue, Byte.class, suggestionsProvider, defaultDescription); this.min = min; this.max = max; } @@ -161,7 +163,7 @@ public final class ByteArgument extends CommandArgument { @Override public @NonNull ByteArgument build() { return new ByteArgument<>(this.isRequired(), this.getName(), this.min, this.max, - this.getDefaultValue(), this.getSuggestionsProvider() + this.getDefaultValue(), this.getSuggestionsProvider(), this.getDefaultDescription() ); } diff --git a/cloud-core/src/main/java/cloud/commandframework/arguments/standard/CharArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/CharArgument.java index 6f33bc58..956d00ee 100644 --- a/cloud-core/src/main/java/cloud/commandframework/arguments/standard/CharArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/CharArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.arguments.standard; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -46,9 +47,10 @@ public final class CharArgument extends CommandArgument { final @NonNull String name, final @NonNull String defaultValue, final @Nullable BiFunction<@NonNull CommandContext, - @NonNull String, @NonNull List<@NonNull String>> suggestionsProvider - ) { - super(required, name, new CharacterParser<>(), defaultValue, Character.class, suggestionsProvider); + @NonNull String, @NonNull List<@NonNull String>> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription + ) { + super(required, name, new CharacterParser<>(), defaultValue, Character.class, suggestionsProvider, defaultDescription); } /** @@ -114,7 +116,7 @@ public final class CharArgument extends CommandArgument { @Override public @NonNull CharArgument build() { return new CharArgument<>(this.isRequired(), this.getName(), - this.getDefaultValue(), this.getSuggestionsProvider() + this.getDefaultValue(), this.getSuggestionsProvider(), this.getDefaultDescription() ); } diff --git a/cloud-core/src/main/java/cloud/commandframework/arguments/standard/DoubleArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/DoubleArgument.java index 2e9b5190..1cbf4fbb 100644 --- a/cloud-core/src/main/java/cloud/commandframework/arguments/standard/DoubleArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/DoubleArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.arguments.standard; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -49,9 +50,10 @@ public final class DoubleArgument extends CommandArgument { final double max, final String defaultValue, final @Nullable BiFunction<@NonNull CommandContext, @NonNull String, - @NonNull List<@NonNull String>> suggestionsProvider + @NonNull List<@NonNull String>> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription ) { - super(required, name, new DoubleParser<>(min, max), defaultValue, Double.class, suggestionsProvider); + super(required, name, new DoubleParser<>(min, max), defaultValue, Double.class, suggestionsProvider, defaultDescription); this.min = min; this.max = max; } @@ -161,7 +163,7 @@ public final class DoubleArgument extends CommandArgument { @Override public @NonNull DoubleArgument build() { return new DoubleArgument<>(this.isRequired(), this.getName(), this.min, this.max, - this.getDefaultValue(), this.getSuggestionsProvider() + this.getDefaultValue(), this.getSuggestionsProvider(), this.getDefaultDescription() ); } diff --git a/cloud-core/src/main/java/cloud/commandframework/arguments/standard/EnumArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/EnumArgument.java index 01e6555c..dfb6bf8a 100644 --- a/cloud-core/src/main/java/cloud/commandframework/arguments/standard/EnumArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/EnumArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.arguments.standard; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -55,9 +56,10 @@ public class EnumArgument> extends CommandArgument { final @NonNull String name, final @NonNull String defaultValue, final @Nullable BiFunction<@NonNull CommandContext, @NonNull String, - @NonNull List<@NonNull String>> suggestionsProvider + @NonNull List<@NonNull String>> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription ) { - super(required, name, new EnumParser<>(enumClass), defaultValue, enumClass, suggestionsProvider); + super(required, name, new EnumParser<>(enumClass), defaultValue, enumClass, suggestionsProvider, defaultDescription); } /** @@ -139,7 +141,7 @@ public class EnumArgument> extends CommandArgument { @Override public @NonNull CommandArgument build() { return new EnumArgument<>(this.enumClass, this.isRequired(), this.getName(), - this.getDefaultValue(), this.getSuggestionsProvider() + this.getDefaultValue(), this.getSuggestionsProvider(), this.getDefaultDescription() ); } diff --git a/cloud-core/src/main/java/cloud/commandframework/arguments/standard/FloatArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/FloatArgument.java index 0b56c504..586098b7 100644 --- a/cloud-core/src/main/java/cloud/commandframework/arguments/standard/FloatArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/FloatArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.arguments.standard; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -49,9 +50,10 @@ public final class FloatArgument extends CommandArgument { final float max, final @NonNull String defaultValue, final @Nullable BiFunction<@NonNull CommandContext, - @NonNull String, @NonNull List<@NonNull String>> suggestionsProvider + @NonNull String, @NonNull List<@NonNull String>> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription ) { - super(required, name, new FloatParser<>(min, max), defaultValue, Float.class, suggestionsProvider); + super(required, name, new FloatParser<>(min, max), defaultValue, Float.class, suggestionsProvider, defaultDescription); this.min = min; this.max = max; } @@ -161,7 +163,7 @@ public final class FloatArgument extends CommandArgument { @Override public @NonNull FloatArgument build() { return new FloatArgument<>(this.isRequired(), this.getName(), this.min, this.max, - this.getDefaultValue(), this.getSuggestionsProvider() + this.getDefaultValue(), this.getSuggestionsProvider(), this.getDefaultDescription() ); } diff --git a/cloud-core/src/main/java/cloud/commandframework/arguments/standard/IntegerArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/IntegerArgument.java index a6a48f2c..a8286012 100644 --- a/cloud-core/src/main/java/cloud/commandframework/arguments/standard/IntegerArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/IntegerArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.arguments.standard; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -56,9 +57,10 @@ public final class IntegerArgument extends CommandArgument { final int max, final String defaultValue, final @Nullable BiFunction<@NonNull CommandContext, @NonNull String, - @NonNull List<@NonNull String>> suggestionsProvider + @NonNull List<@NonNull String>> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription ) { - super(required, name, new IntegerParser<>(min, max), defaultValue, Integer.class, suggestionsProvider); + super(required, name, new IntegerParser<>(min, max), defaultValue, Integer.class, suggestionsProvider, defaultDescription); this.min = min; this.max = max; } @@ -168,7 +170,7 @@ public final class IntegerArgument extends CommandArgument { @Override public @NonNull IntegerArgument build() { return new IntegerArgument<>(this.isRequired(), this.getName(), this.min, this.max, - this.getDefaultValue(), this.getSuggestionsProvider() + this.getDefaultValue(), this.getSuggestionsProvider(), this.getDefaultDescription() ); } diff --git a/cloud-core/src/main/java/cloud/commandframework/arguments/standard/LongArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/LongArgument.java index 7b12886a..74c49c7d 100644 --- a/cloud-core/src/main/java/cloud/commandframework/arguments/standard/LongArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/LongArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.arguments.standard; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -49,9 +50,10 @@ public final class LongArgument extends CommandArgument { final long max, final String defaultValue, final @Nullable BiFunction<@NonNull CommandContext, @NonNull String, - @NonNull List<@NonNull String>> suggestionsProvider + @NonNull List<@NonNull String>> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription ) { - super(required, name, new LongParser<>(min, max), defaultValue, Long.class, suggestionsProvider); + super(required, name, new LongParser<>(min, max), defaultValue, Long.class, suggestionsProvider, defaultDescription); this.min = min; this.max = max; } @@ -161,7 +163,7 @@ public final class LongArgument extends CommandArgument { @Override public @NonNull LongArgument build() { return new LongArgument<>(this.isRequired(), this.getName(), this.min, - this.max, this.getDefaultValue(), this.getSuggestionsProvider() + this.max, this.getDefaultValue(), this.getSuggestionsProvider(), this.getDefaultDescription() ); } diff --git a/cloud-core/src/main/java/cloud/commandframework/arguments/standard/ShortArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/ShortArgument.java index 0b878c67..b4b1c404 100644 --- a/cloud-core/src/main/java/cloud/commandframework/arguments/standard/ShortArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/ShortArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.arguments.standard; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -49,9 +50,10 @@ public final class ShortArgument extends CommandArgument { final short max, final String defaultValue, final @Nullable BiFunction<@NonNull CommandContext, @NonNull String, - @NonNull List> suggestionsProvider + @NonNull List> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription ) { - super(required, name, new ShortParser<>(min, max), defaultValue, Short.class, suggestionsProvider); + super(required, name, new ShortParser<>(min, max), defaultValue, Short.class, suggestionsProvider, defaultDescription); this.min = min; this.max = max; } @@ -161,7 +163,7 @@ public final class ShortArgument extends CommandArgument { @Override public @NonNull ShortArgument build() { return new ShortArgument<>(this.isRequired(), this.getName(), this.min, this.max, - this.getDefaultValue(), this.getSuggestionsProvider() + this.getDefaultValue(), this.getSuggestionsProvider(), this.getDefaultDescription() ); } diff --git a/cloud-core/src/main/java/cloud/commandframework/arguments/standard/StringArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/StringArgument.java index 75fd6ca7..fe1ae59f 100644 --- a/cloud-core/src/main/java/cloud/commandframework/arguments/standard/StringArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/StringArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.arguments.standard; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -56,10 +57,11 @@ public final class StringArgument extends CommandArgument { final @NonNull StringMode stringMode, final @NonNull String defaultValue, final @NonNull BiFunction<@NonNull CommandContext, @NonNull String, - @NonNull List<@NonNull String>> suggestionsProvider + @NonNull List<@NonNull String>> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription ) { super(required, name, new StringParser<>(stringMode, suggestionsProvider), - defaultValue, String.class, suggestionsProvider + defaultValue, String.class, suggestionsProvider, defaultDescription ); this.stringMode = stringMode; } @@ -265,7 +267,7 @@ public final class StringArgument extends CommandArgument { @Override public @NonNull StringArgument build() { return new StringArgument<>(this.isRequired(), this.getName(), this.stringMode, - this.getDefaultValue(), this.suggestionsProvider + this.getDefaultValue(), this.suggestionsProvider, this.getDefaultDescription() ); } diff --git a/cloud-core/src/main/java/cloud/commandframework/arguments/standard/StringArrayArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/StringArrayArgument.java index ee769df1..533b0f38 100644 --- a/cloud-core/src/main/java/cloud/commandframework/arguments/standard/StringArrayArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/StringArrayArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.arguments.standard; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -47,7 +48,8 @@ public final class StringArrayArgument extends CommandArgument { private StringArrayArgument( final boolean required, final @NonNull String name, - final @Nullable BiFunction, String, List> suggestionsProvider + final @Nullable BiFunction, String, List> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription ) { super( required, @@ -55,7 +57,8 @@ public final class StringArrayArgument extends CommandArgument { new StringArrayParser<>(), "", TypeToken.get(String[].class), - suggestionsProvider + suggestionsProvider, + defaultDescription ); } @@ -74,7 +77,8 @@ public final class StringArrayArgument extends CommandArgument { return new StringArrayArgument<>( true, name, - suggestionsProvider + suggestionsProvider, + ArgumentDescription.empty() ); } @@ -93,7 +97,8 @@ public final class StringArrayArgument extends CommandArgument { return new StringArrayArgument<>( false, name, - suggestionsProvider + suggestionsProvider, + ArgumentDescription.empty() ); } diff --git a/cloud-core/src/main/java/cloud/commandframework/arguments/standard/UUIDArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/UUIDArgument.java index 49cba9f0..010378d6 100644 --- a/cloud-core/src/main/java/cloud/commandframework/arguments/standard/UUIDArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/UUIDArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.arguments.standard; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -47,9 +48,10 @@ public final class UUIDArgument extends CommandArgument { final @NonNull String name, final @NonNull String defaultValue, final @Nullable BiFunction<@NonNull CommandContext, - @NonNull String, @NonNull List<@NonNull String>> suggestionsProvider + @NonNull String, @NonNull List<@NonNull String>> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription ) { - super(required, name, new UUIDParser<>(), defaultValue, UUID.class, suggestionsProvider); + super(required, name, new UUIDParser<>(), defaultValue, UUID.class, suggestionsProvider, defaultDescription); } /** @@ -114,7 +116,13 @@ public final class UUIDArgument extends CommandArgument { */ @Override public @NonNull UUIDArgument build() { - return new UUIDArgument<>(this.isRequired(), this.getName(), this.getDefaultValue(), this.getSuggestionsProvider()); + return new UUIDArgument<>( + this.isRequired(), + this.getName(), + this.getDefaultValue(), + this.getSuggestionsProvider(), + this.getDefaultDescription() + ); } } diff --git a/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/EnchantmentArgument.java b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/EnchantmentArgument.java index 39ee2f27..47331432 100644 --- a/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/EnchantmentArgument.java +++ b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/EnchantmentArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.bukkit.parsers; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -53,9 +54,10 @@ public class EnchantmentArgument extends CommandArgument { final @NonNull String name, final @NonNull String defaultValue, final @Nullable BiFunction<@NonNull CommandContext, @NonNull String, - @NonNull List<@NonNull String>> suggestionsProvider - ) { - super(required, name, new EnchantmentParser<>(), defaultValue, Enchantment.class, suggestionsProvider); + @NonNull List<@NonNull String>> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription + ) { + super(required, name, new EnchantmentParser<>(), defaultValue, Enchantment.class, suggestionsProvider, defaultDescription); } /** @@ -118,7 +120,8 @@ public class EnchantmentArgument extends CommandArgument { this.isRequired(), this.getName(), this.getDefaultValue(), - this.getSuggestionsProvider() + this.getSuggestionsProvider(), + this.getDefaultDescription() ); } diff --git a/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/MaterialArgument.java b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/MaterialArgument.java index 3409e720..6a0e03df 100644 --- a/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/MaterialArgument.java +++ b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/MaterialArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.bukkit.parsers; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -52,8 +53,9 @@ public class MaterialArgument extends CommandArgument { final @NonNull String name, final @NonNull String defaultValue, final @Nullable BiFunction<@NonNull CommandContext, @NonNull String, - @NonNull List<@NonNull String>> suggestionsProvider - ) { + @NonNull List<@NonNull String>> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription + ) { super(required, name, new MaterialParser<>(), defaultValue, Material.class, suggestionsProvider); } @@ -117,7 +119,8 @@ public class MaterialArgument extends CommandArgument { this.isRequired(), this.getName(), this.getDefaultValue(), - this.getSuggestionsProvider() + this.getSuggestionsProvider(), + this.getDefaultDescription() ); } diff --git a/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/OfflinePlayerArgument.java b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/OfflinePlayerArgument.java index a1d14a5b..31a841cc 100644 --- a/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/OfflinePlayerArgument.java +++ b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/OfflinePlayerArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.bukkit.parsers; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -58,9 +59,18 @@ public final class OfflinePlayerArgument extends CommandArgument, @NonNull String, - @NonNull List<@NonNull String>> suggestionsProvider + @NonNull List<@NonNull String>> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription ) { - super(required, name, new OfflinePlayerParser<>(), defaultValue, OfflinePlayer.class, suggestionsProvider); + super( + required, + name, + new OfflinePlayerParser<>(), + defaultValue, + OfflinePlayer.class, + suggestionsProvider, + defaultDescription + ); } /** @@ -126,7 +136,7 @@ public final class OfflinePlayerArgument extends CommandArgument build() { return new OfflinePlayerArgument<>(this.isRequired(), this.getName(), this.getDefaultValue(), - this.getSuggestionsProvider() + this.getSuggestionsProvider(), this.getDefaultDescription() ); } diff --git a/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/PlayerArgument.java b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/PlayerArgument.java index d927de4d..4cbbf010 100644 --- a/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/PlayerArgument.java +++ b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/PlayerArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.bukkit.parsers; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -54,9 +55,10 @@ public final class PlayerArgument extends CommandArgument { final @NonNull String name, final @NonNull String defaultValue, final @Nullable BiFunction<@NonNull CommandContext, @NonNull String, - @NonNull List<@NonNull String>> suggestionsProvider + @NonNull List<@NonNull String>> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription ) { - super(required, name, new PlayerParser<>(), defaultValue, Player.class, suggestionsProvider); + super(required, name, new PlayerParser<>(), defaultValue, Player.class, suggestionsProvider, defaultDescription); } /** @@ -121,7 +123,13 @@ public final class PlayerArgument extends CommandArgument { */ @Override public @NonNull PlayerArgument build() { - return new PlayerArgument<>(this.isRequired(), this.getName(), this.getDefaultValue(), this.getSuggestionsProvider()); + return new PlayerArgument<>( + this.isRequired(), + this.getName(), + this.getDefaultValue(), + this.getSuggestionsProvider(), + this.getDefaultDescription() + ); } } diff --git a/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/WorldArgument.java b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/WorldArgument.java index f5b0b5cd..86353874 100644 --- a/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/WorldArgument.java +++ b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/WorldArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.bukkit.parsers; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -52,9 +53,10 @@ public class WorldArgument extends CommandArgument { final boolean required, final @NonNull String name, final @NonNull String defaultValue, - final @Nullable BiFunction, String, List> suggestionsProvider + final @Nullable BiFunction, String, List> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription ) { - super(required, name, new WorldParser<>(), defaultValue, World.class, suggestionsProvider); + super(required, name, new WorldParser<>(), defaultValue, World.class, suggestionsProvider, defaultDescription); } /** @@ -114,7 +116,13 @@ public class WorldArgument extends CommandArgument { @Override public @NonNull CommandArgument build() { - return new WorldArgument<>(this.isRequired(), this.getName(), this.getDefaultValue(), this.getSuggestionsProvider()); + return new WorldArgument<>( + this.isRequired(), + this.getName(), + this.getDefaultValue(), + this.getSuggestionsProvider(), + this.getDefaultDescription() + ); } } diff --git a/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/location/Location2DArgument.java b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/location/Location2DArgument.java index 6aebfe7d..84359354 100644 --- a/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/location/Location2DArgument.java +++ b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/location/Location2DArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.bukkit.parsers.location; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -57,6 +58,7 @@ public final class Location2DArgument extends CommandArgument final boolean required, final @NonNull String name, final @NonNull String defaultValue, + final @NonNull ArgumentDescription defaultDescription, final @Nullable BiFunction, String, List> suggestionsProvider, final @NonNull Collection<@NonNull BiFunction<@NonNull CommandContext, @NonNull Queue<@NonNull String>, @NonNull ArgumentParseResult>> argumentPreprocessors @@ -68,6 +70,7 @@ public final class Location2DArgument extends CommandArgument defaultValue, TypeToken.get(Location2D.class), suggestionsProvider, + defaultDescription, argumentPreprocessors ); } @@ -133,6 +136,7 @@ public final class Location2DArgument extends CommandArgument this.isRequired(), this.getName(), this.getDefaultValue(), + this.getDefaultDescription(), this.getSuggestionsProvider(), new LinkedList<>() ); diff --git a/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/location/LocationArgument.java b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/location/LocationArgument.java index 148d3e43..9d939fe4 100644 --- a/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/location/LocationArgument.java +++ b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/location/LocationArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.bukkit.parsers.location; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -63,6 +64,7 @@ public final class LocationArgument extends CommandArgument { final @NonNull String name, final @NonNull String defaultValue, final @Nullable BiFunction, String, List> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription, final @NonNull Collection<@NonNull BiFunction<@NonNull CommandContext, @NonNull Queue<@NonNull String>, @NonNull ArgumentParseResult>> argumentPreprocessors ) { @@ -73,6 +75,7 @@ public final class LocationArgument extends CommandArgument { defaultValue, TypeToken.get(Location.class), suggestionsProvider, + defaultDescription, argumentPreprocessors ); } @@ -139,6 +142,7 @@ public final class LocationArgument extends CommandArgument { this.getName(), this.getDefaultValue(), this.getSuggestionsProvider(), + this.getDefaultDescription(), new LinkedList<>() ); } diff --git a/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/selector/MultipleEntitySelectorArgument.java b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/selector/MultipleEntitySelectorArgument.java index 331c14ab..f8ad6a87 100644 --- a/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/selector/MultipleEntitySelectorArgument.java +++ b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/selector/MultipleEntitySelectorArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.bukkit.parsers.selector; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -47,10 +48,11 @@ public final class MultipleEntitySelectorArgument extends CommandArgument, @NonNull String, - @NonNull List<@NonNull String>> suggestionsProvider + @NonNull List<@NonNull String>> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription ) { super(required, name, new MultipleEntitySelectorParser<>(), defaultValue, MultipleEntitySelector.class, - suggestionsProvider + suggestionsProvider, defaultDescription ); } @@ -117,7 +119,7 @@ public final class MultipleEntitySelectorArgument extends CommandArgument build() { return new MultipleEntitySelectorArgument<>(this.isRequired(), this.getName(), this.getDefaultValue(), - this.getSuggestionsProvider() + this.getSuggestionsProvider(), this.getDefaultDescription() ); } diff --git a/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/selector/MultiplePlayerSelectorArgument.java b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/selector/MultiplePlayerSelectorArgument.java index 0d9da7ff..c4bb72b5 100644 --- a/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/selector/MultiplePlayerSelectorArgument.java +++ b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/selector/MultiplePlayerSelectorArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.bukkit.parsers.selector; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -51,10 +52,11 @@ public final class MultiplePlayerSelectorArgument extends CommandArgument, @NonNull String, - @NonNull List<@NonNull String>> suggestionsProvider + @NonNull List<@NonNull String>> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription ) { super(required, name, new MultiplePlayerSelectorParser<>(), defaultValue, MultiplePlayerSelector.class, - suggestionsProvider + suggestionsProvider, defaultDescription ); } @@ -121,7 +123,7 @@ public final class MultiplePlayerSelectorArgument extends CommandArgument build() { return new MultiplePlayerSelectorArgument<>(this.isRequired(), this.getName(), this.getDefaultValue(), - this.getSuggestionsProvider() + this.getSuggestionsProvider(), this.getDefaultDescription() ); } diff --git a/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/selector/SingleEntitySelectorArgument.java b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/selector/SingleEntitySelectorArgument.java index e9b04291..e487758e 100644 --- a/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/selector/SingleEntitySelectorArgument.java +++ b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/selector/SingleEntitySelectorArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.bukkit.parsers.selector; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -47,9 +48,18 @@ public final class SingleEntitySelectorArgument extends CommandArgument, @NonNull String, - @NonNull List<@NonNull String>> suggestionsProvider + @NonNull List<@NonNull String>> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription ) { - super(required, name, new SingleEntitySelectorParser<>(), defaultValue, SingleEntitySelector.class, suggestionsProvider); + super( + required, + name, + new SingleEntitySelectorParser<>(), + defaultValue, + SingleEntitySelector.class, + suggestionsProvider, + defaultDescription + ); } /** @@ -115,7 +125,7 @@ public final class SingleEntitySelectorArgument extends CommandArgument build() { return new SingleEntitySelectorArgument<>(this.isRequired(), this.getName(), this.getDefaultValue(), - this.getSuggestionsProvider() + this.getSuggestionsProvider(), this.getDefaultDescription() ); } diff --git a/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/selector/SinglePlayerSelectorArgument.java b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/selector/SinglePlayerSelectorArgument.java index 47f0a6b6..24dd66b9 100644 --- a/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/selector/SinglePlayerSelectorArgument.java +++ b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/selector/SinglePlayerSelectorArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.bukkit.parsers.selector; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -51,9 +52,18 @@ public final class SinglePlayerSelectorArgument extends CommandArgument, @NonNull String, - @NonNull List<@NonNull String>> suggestionsProvider + @NonNull List<@NonNull String>> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription ) { - super(required, name, new SinglePlayerSelectorParser<>(), defaultValue, SinglePlayerSelector.class, suggestionsProvider); + super( + required, + name, + new SinglePlayerSelectorParser<>(), + defaultValue, + SinglePlayerSelector.class, + suggestionsProvider, + defaultDescription + ); } /** @@ -119,7 +129,7 @@ public final class SinglePlayerSelectorArgument extends CommandArgument build() { return new SinglePlayerSelectorArgument<>(this.isRequired(), this.getName(), this.getDefaultValue(), - this.getSuggestionsProvider() + this.getSuggestionsProvider(), this.getDefaultDescription() ); } diff --git a/cloud-minecraft/cloud-bungee/src/main/java/cloud/commandframework/bungee/arguments/PlayerArgument.java b/cloud-minecraft/cloud-bungee/src/main/java/cloud/commandframework/bungee/arguments/PlayerArgument.java index 1675ab11..c9daf90d 100644 --- a/cloud-minecraft/cloud-bungee/src/main/java/cloud/commandframework/bungee/arguments/PlayerArgument.java +++ b/cloud-minecraft/cloud-bungee/src/main/java/cloud/commandframework/bungee/arguments/PlayerArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.bungee.arguments; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -56,6 +57,7 @@ public final class PlayerArgument extends CommandArgument { final boolean required, final @NonNull String name, final @Nullable BiFunction, String, List> suggestionProvider, + final @NonNull ArgumentDescription defaultDescription, final @NonNull Collection<@NonNull BiFunction<@NonNull CommandContext, @NonNull Queue<@NonNull String>, @NonNull ArgumentParseResult>> argumentPreprocessors ) { @@ -66,6 +68,7 @@ public final class PlayerArgument extends CommandArgument { "", TypeToken.get(ProxiedPlayer.class), suggestionProvider, + defaultDescription, argumentPreprocessors ); } @@ -128,6 +131,7 @@ public final class PlayerArgument extends CommandArgument { this.isRequired(), this.getName(), this.getSuggestionsProvider(), + this.getDefaultDescription(), new LinkedList<>() ); } diff --git a/cloud-minecraft/cloud-bungee/src/main/java/cloud/commandframework/bungee/arguments/ServerArgument.java b/cloud-minecraft/cloud-bungee/src/main/java/cloud/commandframework/bungee/arguments/ServerArgument.java index 2928c5e8..4814f82b 100644 --- a/cloud-minecraft/cloud-bungee/src/main/java/cloud/commandframework/bungee/arguments/ServerArgument.java +++ b/cloud-minecraft/cloud-bungee/src/main/java/cloud/commandframework/bungee/arguments/ServerArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.bungee.arguments; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -56,6 +57,7 @@ public final class ServerArgument extends CommandArgument { final boolean required, final @NonNull String name, final @Nullable BiFunction, String, List> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription, final @NonNull Collection<@NonNull BiFunction<@NonNull CommandContext, @NonNull Queue<@NonNull String>, @NonNull ArgumentParseResult>> argumentPreprocessors ) { @@ -66,6 +68,7 @@ public final class ServerArgument extends CommandArgument { "", TypeToken.get(ServerInfo.class), suggestionsProvider, + defaultDescription, argumentPreprocessors ); } @@ -127,6 +130,7 @@ public final class ServerArgument extends CommandArgument { this.isRequired(), this.getName(), this.getSuggestionsProvider(), + this.getDefaultDescription(), new LinkedList<>() ); } diff --git a/cloud-minecraft/cloud-velocity/src/main/java/cloud/commandframework/velocity/arguments/PlayerArgument.java b/cloud-minecraft/cloud-velocity/src/main/java/cloud/commandframework/velocity/arguments/PlayerArgument.java index a2766a11..99503f06 100644 --- a/cloud-minecraft/cloud-velocity/src/main/java/cloud/commandframework/velocity/arguments/PlayerArgument.java +++ b/cloud-minecraft/cloud-velocity/src/main/java/cloud/commandframework/velocity/arguments/PlayerArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.velocity.arguments; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -56,6 +57,7 @@ public final class PlayerArgument extends CommandArgument { final boolean required, final @NonNull String name, final @Nullable BiFunction, String, List> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription, final @NonNull Collection<@NonNull BiFunction<@NonNull CommandContext, @NonNull Queue<@NonNull String>, @NonNull ArgumentParseResult>> argumentPreprocessors ) { @@ -66,6 +68,7 @@ public final class PlayerArgument extends CommandArgument { "", TypeToken.get(Player.class), suggestionsProvider, + defaultDescription, argumentPreprocessors ); } @@ -126,6 +129,7 @@ public final class PlayerArgument extends CommandArgument { this.isRequired(), this.getName(), this.getSuggestionsProvider(), + this.getDefaultDescription(), new LinkedList<>() ); } diff --git a/cloud-minecraft/cloud-velocity/src/main/java/cloud/commandframework/velocity/arguments/ServerArgument.java b/cloud-minecraft/cloud-velocity/src/main/java/cloud/commandframework/velocity/arguments/ServerArgument.java index 819ee4b5..85d7eefe 100644 --- a/cloud-minecraft/cloud-velocity/src/main/java/cloud/commandframework/velocity/arguments/ServerArgument.java +++ b/cloud-minecraft/cloud-velocity/src/main/java/cloud/commandframework/velocity/arguments/ServerArgument.java @@ -23,6 +23,7 @@ // package cloud.commandframework.velocity.arguments; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; @@ -56,6 +57,7 @@ public final class ServerArgument extends CommandArgument, String, List> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription, final @NonNull Collection<@NonNull BiFunction<@NonNull CommandContext, @NonNull Queue<@NonNull String>, @NonNull ArgumentParseResult>> argumentPreprocessors ) { @@ -66,6 +68,7 @@ public final class ServerArgument extends CommandArgument extends CommandArgument() ); }