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

@ -23,6 +23,7 @@
// //
package cloud.commandframework.jda.parsers; package cloud.commandframework.jda.parsers;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParseResult;
import cloud.commandframework.arguments.parser.ArgumentParser; import cloud.commandframework.arguments.parser.ArgumentParser;
@ -32,12 +33,14 @@ import net.dv8tion.jda.api.entities.MessageChannel;
import net.dv8tion.jda.api.entities.TextChannel; import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Queue; import java.util.Queue;
import java.util.Set; import java.util.Set;
import java.util.function.BiFunction;
/** /**
* Command Argument for {@link MessageChannel} * Command Argument for {@link MessageChannel}
@ -50,10 +53,23 @@ public final class ChannelArgument<C> extends CommandArgument<C, MessageChannel>
private final Set<ParserMode> modes; private final Set<ParserMode> modes;
private ChannelArgument( private ChannelArgument(
final boolean required, final @NonNull String name, final boolean required,
final @NonNull String name,
final @NonNull String defaultValue,
final @Nullable BiFunction<@NonNull CommandContext<C>,
@NonNull String, @NonNull List<@NonNull String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription,
final @NonNull Set<ParserMode> modes final @NonNull Set<ParserMode> modes
) { ) {
super(required, name, new MessageParser<>(modes), MessageChannel.class); super(
required,
name,
new MessageParser<>(modes),
defaultValue,
MessageChannel.class,
suggestionsProvider,
defaultDescription
);
this.modes = modes; this.modes = modes;
} }
@ -133,7 +149,14 @@ public final class ChannelArgument<C> extends CommandArgument<C, MessageChannel>
*/ */
@Override @Override
public @NonNull ChannelArgument<C> build() { public @NonNull ChannelArgument<C> build() {
return new ChannelArgument<>(this.isRequired(), this.getName(), this.modes); return new ChannelArgument<>(
this.isRequired(),
this.getName(),
this.getDefaultValue(),
this.getSuggestionsProvider(),
this.getDefaultDescription(),
this.modes
);
} }
} }

View file

@ -23,6 +23,7 @@
// //
package cloud.commandframework.jda.parsers; package cloud.commandframework.jda.parsers;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParseResult;
import cloud.commandframework.arguments.parser.ArgumentParser; import cloud.commandframework.arguments.parser.ArgumentParser;
@ -31,12 +32,14 @@ import cloud.commandframework.exceptions.parsing.NoInputProvidedException;
import net.dv8tion.jda.api.entities.Role; import net.dv8tion.jda.api.entities.Role;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Queue; import java.util.Queue;
import java.util.Set; import java.util.Set;
import java.util.function.BiFunction;
/** /**
* Command Argument for {@link net.dv8tion.jda.api.entities.Role} * Command Argument for {@link net.dv8tion.jda.api.entities.Role}
@ -51,9 +54,13 @@ public final class RoleArgument<C> extends CommandArgument<C, Role> {
private RoleArgument( private RoleArgument(
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue,
final @Nullable BiFunction<@NonNull CommandContext<C>,
@NonNull String, @NonNull List<@NonNull String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription,
final @NonNull Set<ParserMode> modes final @NonNull Set<ParserMode> modes
) { ) {
super(required, name, new RoleParser<>(modes), Role.class); super(required, name, new RoleParser<>(modes), defaultValue, Role.class, suggestionsProvider, defaultDescription);
this.modes = modes; this.modes = modes;
} }
@ -133,7 +140,14 @@ public final class RoleArgument<C> extends CommandArgument<C, Role> {
*/ */
@Override @Override
public @NonNull RoleArgument<C> build() { public @NonNull RoleArgument<C> build() {
return new RoleArgument<>(this.isRequired(), this.getName(), this.modes); return new RoleArgument<>(
this.isRequired(),
this.getName(),
this.getDefaultValue(),
this.getSuggestionsProvider(),
this.getDefaultDescription(),
this.modes
);
} }
} }

View file

@ -23,6 +23,7 @@
// //
package cloud.commandframework.jda.parsers; package cloud.commandframework.jda.parsers;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParseResult;
import cloud.commandframework.arguments.parser.ArgumentParser; import cloud.commandframework.arguments.parser.ArgumentParser;
@ -32,6 +33,7 @@ import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.entities.User; import net.dv8tion.jda.api.entities.User;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.Collections; import java.util.Collections;
@ -39,6 +41,7 @@ import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Queue; import java.util.Queue;
import java.util.Set; import java.util.Set;
import java.util.function.BiFunction;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -54,11 +57,24 @@ public final class UserArgument<C> extends CommandArgument<C, User> {
private final Isolation isolationLevel; private final Isolation isolationLevel;
private UserArgument( private UserArgument(
final boolean required, final @NonNull String name, final boolean required,
final @NonNull String name,
final @NonNull String defaultValue,
final @Nullable BiFunction<@NonNull CommandContext<C>,
@NonNull String, @NonNull List<@NonNull String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription,
final @NonNull Set<ParserMode> modes, final @NonNull Set<ParserMode> modes,
final @NonNull Isolation isolationLevel final @NonNull Isolation isolationLevel
) { ) {
super(required, name, new UserParser<>(modes, isolationLevel), User.class); super(
required,
name,
new UserParser<>(modes, isolationLevel),
defaultValue,
User.class,
suggestionsProvider,
defaultDescription
);
this.modes = modes; this.modes = modes;
this.isolationLevel = isolationLevel; this.isolationLevel = isolationLevel;
} }
@ -167,7 +183,15 @@ public final class UserArgument<C> extends CommandArgument<C, User> {
*/ */
@Override @Override
public @NonNull UserArgument<C> build() { public @NonNull UserArgument<C> build() {
return new UserArgument<>(this.isRequired(), this.getName(), this.modes, this.isolationLevel); return new UserArgument<>(
this.isRequired(),
this.getName(),
this.getDefaultValue(),
this.getSuggestionsProvider(),
this.getDefaultDescription(),
this.modes,
this.isolationLevel
);
} }
} }

View file

@ -23,6 +23,7 @@
// //
package cloud.commandframework.pircbotx.arguments; package cloud.commandframework.pircbotx.arguments;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParseResult;
import cloud.commandframework.arguments.parser.ArgumentParser; import cloud.commandframework.arguments.parser.ArgumentParser;
@ -37,8 +38,6 @@ import org.checkerframework.checker.nullness.qual.Nullable;
import org.pircbotx.PircBotX; import org.pircbotx.PircBotX;
import org.pircbotx.User; import org.pircbotx.User;
import org.pircbotx.exception.DaoException; import org.pircbotx.exception.DaoException;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Queue; import java.util.Queue;
import java.util.function.BiFunction; import java.util.function.BiFunction;
@ -54,16 +53,19 @@ public final class UserArgument<C> extends CommandArgument<C, User> {
private UserArgument( private UserArgument(
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider final @NonNull String defaultValue,
final @Nullable BiFunction<@NonNull CommandContext<C>,
@NonNull String, @NonNull List<@NonNull String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription
) { ) {
super( super(
required, required,
name, name,
new UserArgumentParser<>(), new UserArgumentParser<>(),
"", defaultValue,
TypeToken.get(User.class), TypeToken.get(User.class),
suggestionsProvider, suggestionsProvider,
new LinkedList<>() defaultDescription
); );
} }
@ -117,7 +119,9 @@ public final class UserArgument<C> extends CommandArgument<C, User> {
return new UserArgument<>( return new UserArgument<>(
this.isRequired(), this.isRequired(),
this.getName(), this.getName(),
this.getSuggestionsProvider() this.getDefaultValue(),
this.getSuggestionsProvider(),
this.getDefaultDescription()
); );
} }

View file

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

View file

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

View file

@ -24,6 +24,7 @@
package cloud.commandframework.fabric.argument; package cloud.commandframework.fabric.argument;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser; import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
import cloud.commandframework.context.CommandContext; import cloud.commandframework.context.CommandContext;
@ -46,7 +47,8 @@ public final class AngleArgument<C> extends CommandArgument<C, AngleArgumentType
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription
) { ) {
super( super(
required, required,
@ -54,7 +56,8 @@ public final class AngleArgument<C> extends CommandArgument<C, AngleArgumentType
new WrappedBrigadierParser<>(AngleArgumentType.angle()), new WrappedBrigadierParser<>(AngleArgumentType.angle()),
defaultValue, defaultValue,
AngleArgumentType.Angle.class, AngleArgumentType.Angle.class,
suggestionsProvider suggestionsProvider,
defaultDescription
); );
} }
@ -131,7 +134,13 @@ public final class AngleArgument<C> extends CommandArgument<C, AngleArgumentType
*/ */
@Override @Override
public @NonNull AngleArgument<C> build() { public @NonNull AngleArgument<C> build() {
return new AngleArgument<>(this.isRequired(), this.getName(), this.getDefaultValue(), this.getSuggestionsProvider()); return new AngleArgument<>(
this.isRequired(),
this.getName(),
this.getDefaultValue(),
this.getSuggestionsProvider(),
this.getDefaultDescription()
);
} }
} }

View file

@ -24,6 +24,7 @@
package cloud.commandframework.fabric.argument; package cloud.commandframework.fabric.argument;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser; import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
import cloud.commandframework.context.CommandContext; import cloud.commandframework.context.CommandContext;
@ -53,7 +54,8 @@ public final class AxisArgument<C> extends CommandArgument<C, EnumSet<Direction.
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription
) { ) {
super( super(
required, required,
@ -61,7 +63,8 @@ public final class AxisArgument<C> extends CommandArgument<C, EnumSet<Direction.
new WrappedBrigadierParser<>(SwizzleArgumentType.swizzle()), new WrappedBrigadierParser<>(SwizzleArgumentType.swizzle()),
defaultValue, defaultValue,
TYPE, TYPE,
suggestionsProvider suggestionsProvider,
defaultDescription
); );
} }
@ -142,7 +145,13 @@ public final class AxisArgument<C> extends CommandArgument<C, EnumSet<Direction.
*/ */
@Override @Override
public @NonNull AxisArgument<C> build() { public @NonNull AxisArgument<C> build() {
return new AxisArgument<>(this.isRequired(), this.getName(), this.getDefaultValue(), this.getSuggestionsProvider()); return new AxisArgument<>(
this.isRequired(),
this.getName(),
this.getDefaultValue(),
this.getSuggestionsProvider(),
this.getDefaultDescription()
);
} }
} }

View file

@ -24,6 +24,7 @@
package cloud.commandframework.fabric.argument; package cloud.commandframework.fabric.argument;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser; import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
import cloud.commandframework.context.CommandContext; import cloud.commandframework.context.CommandContext;
@ -47,10 +48,17 @@ public final class ColorArgument<C> extends CommandArgument<C, Formatting> {
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription
) { ) {
super(required, name, new WrappedBrigadierParser<>(ColorArgumentType.color()), defaultValue, Formatting.class, super(
suggestionsProvider required,
name,
new WrappedBrigadierParser<>(ColorArgumentType.color()),
defaultValue,
Formatting.class,
suggestionsProvider,
defaultDescription
); );
} }
@ -130,7 +138,13 @@ public final class ColorArgument<C> extends CommandArgument<C, Formatting> {
*/ */
@Override @Override
public @NonNull ColorArgument<C> build() { public @NonNull ColorArgument<C> build() {
return new ColorArgument<>(this.isRequired(), this.getName(), this.getDefaultValue(), this.getSuggestionsProvider()); return new ColorArgument<>(
this.isRequired(),
this.getName(),
this.getDefaultValue(),
this.getSuggestionsProvider(),
this.getDefaultDescription()
);
} }
} }

View file

@ -24,6 +24,7 @@
package cloud.commandframework.fabric.argument; package cloud.commandframework.fabric.argument;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser; import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
import cloud.commandframework.context.CommandContext; import cloud.commandframework.context.CommandContext;
@ -47,7 +48,8 @@ public final class CompoundTagArgument<C> extends CommandArgument<C, CompoundTag
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription
) { ) {
super( super(
required, required,
@ -55,7 +57,8 @@ public final class CompoundTagArgument<C> extends CommandArgument<C, CompoundTag
new WrappedBrigadierParser<>(NbtCompoundTagArgumentType.nbtCompound()), new WrappedBrigadierParser<>(NbtCompoundTagArgumentType.nbtCompound()),
defaultValue, defaultValue,
CompoundTag.class, CompoundTag.class,
suggestionsProvider suggestionsProvider,
defaultDescription
); );
} }
@ -136,7 +139,8 @@ public final class CompoundTagArgument<C> extends CommandArgument<C, CompoundTag
this.isRequired(), this.isRequired(),
this.getName(), this.getName(),
this.getDefaultValue(), this.getDefaultValue(),
this.getSuggestionsProvider() this.getSuggestionsProvider(),
this.getDefaultDescription()
); );
} }

View file

@ -24,6 +24,7 @@
package cloud.commandframework.fabric.argument; package cloud.commandframework.fabric.argument;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser; import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
import cloud.commandframework.context.CommandContext; import cloud.commandframework.context.CommandContext;
@ -46,7 +47,8 @@ public final class EntityAnchorArgument<C> extends CommandArgument<C, EntityAnch
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription
) { ) {
super( super(
required, required,
@ -54,7 +56,8 @@ public final class EntityAnchorArgument<C> extends CommandArgument<C, EntityAnch
new WrappedBrigadierParser<>(EntityAnchorArgumentType.entityAnchor()), new WrappedBrigadierParser<>(EntityAnchorArgumentType.entityAnchor()),
defaultValue, defaultValue,
EntityAnchorArgumentType.EntityAnchor.class, EntityAnchorArgumentType.EntityAnchor.class,
suggestionsProvider suggestionsProvider,
defaultDescription
); );
} }
@ -135,7 +138,8 @@ public final class EntityAnchorArgument<C> extends CommandArgument<C, EntityAnch
this.isRequired(), this.isRequired(),
this.getName(), this.getName(),
this.getDefaultValue(), this.getDefaultValue(),
this.getSuggestionsProvider() this.getSuggestionsProvider(),
this.getDefaultDescription()
); );
} }

View file

@ -24,6 +24,7 @@
package cloud.commandframework.fabric.argument; package cloud.commandframework.fabric.argument;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser; import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
import cloud.commandframework.context.CommandContext; import cloud.commandframework.context.CommandContext;
@ -48,7 +49,8 @@ public final class FloatRangeArgument<C> extends CommandArgument<C, NumberRange.
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription
) { ) {
super( super(
required, required,
@ -56,7 +58,8 @@ public final class FloatRangeArgument<C> extends CommandArgument<C, NumberRange.
new WrappedBrigadierParser<>(NumberRangeArgumentType.method_30918()), new WrappedBrigadierParser<>(NumberRangeArgumentType.method_30918()),
defaultValue, defaultValue,
NumberRange.FloatRange.class, NumberRange.FloatRange.class,
suggestionsProvider suggestionsProvider,
defaultDescription
); );
} }
@ -146,7 +149,8 @@ public final class FloatRangeArgument<C> extends CommandArgument<C, NumberRange.
this.isRequired(), this.isRequired(),
this.getName(), this.getName(),
this.getDefaultValue(), this.getDefaultValue(),
this.getSuggestionsProvider() this.getSuggestionsProvider(),
this.getDefaultDescription()
); );
} }

View file

@ -24,6 +24,7 @@
package cloud.commandframework.fabric.argument; package cloud.commandframework.fabric.argument;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser; import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
import cloud.commandframework.context.CommandContext; import cloud.commandframework.context.CommandContext;
@ -47,7 +48,8 @@ public final class IdentifierArgument<C> extends CommandArgument<C, Identifier>
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription
) { ) {
super( super(
required, required,
@ -55,7 +57,8 @@ public final class IdentifierArgument<C> extends CommandArgument<C, Identifier>
new WrappedBrigadierParser<>(IdentifierArgumentType.identifier()), new WrappedBrigadierParser<>(IdentifierArgumentType.identifier()),
defaultValue, defaultValue,
Identifier.class, Identifier.class,
suggestionsProvider suggestionsProvider,
defaultDescription
); );
} }
@ -136,7 +139,8 @@ public final class IdentifierArgument<C> extends CommandArgument<C, Identifier>
this.isRequired(), this.isRequired(),
this.getName(), this.getName(),
this.getDefaultValue(), this.getDefaultValue(),
this.getSuggestionsProvider() this.getSuggestionsProvider(),
this.getDefaultDescription()
); );
} }

View file

@ -24,6 +24,7 @@
package cloud.commandframework.fabric.argument; package cloud.commandframework.fabric.argument;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser; import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
import cloud.commandframework.context.CommandContext; import cloud.commandframework.context.CommandContext;
@ -48,7 +49,8 @@ public final class IntRangeArgument<C> extends CommandArgument<C, NumberRange.In
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription
) { ) {
super( super(
required, required,
@ -56,7 +58,8 @@ public final class IntRangeArgument<C> extends CommandArgument<C, NumberRange.In
new WrappedBrigadierParser<>(NumberRangeArgumentType.numberRange()), new WrappedBrigadierParser<>(NumberRangeArgumentType.numberRange()),
defaultValue, defaultValue,
NumberRange.IntRange.class, NumberRange.IntRange.class,
suggestionsProvider suggestionsProvider,
defaultDescription
); );
} }
@ -146,7 +149,8 @@ public final class IntRangeArgument<C> extends CommandArgument<C, NumberRange.In
this.isRequired(), this.isRequired(),
this.getName(), this.getName(),
this.getDefaultValue(), this.getDefaultValue(),
this.getSuggestionsProvider() this.getSuggestionsProvider(),
this.getDefaultDescription()
); );
} }

View file

@ -24,6 +24,7 @@
package cloud.commandframework.fabric.argument; package cloud.commandframework.fabric.argument;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser; import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
import cloud.commandframework.context.CommandContext; import cloud.commandframework.context.CommandContext;
@ -49,7 +50,8 @@ public final class ItemDataArgument<C> extends CommandArgument<C, ItemStackArgum
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription
) { ) {
super( super(
required, required,
@ -57,7 +59,8 @@ public final class ItemDataArgument<C> extends CommandArgument<C, ItemStackArgum
new WrappedBrigadierParser<>(ItemStackArgumentType.itemStack()), new WrappedBrigadierParser<>(ItemStackArgumentType.itemStack()),
defaultValue, defaultValue,
ItemStackArgument.class, ItemStackArgument.class,
suggestionsProvider suggestionsProvider,
defaultDescription
); );
} }
@ -143,7 +146,8 @@ public final class ItemDataArgument<C> extends CommandArgument<C, ItemStackArgum
this.isRequired(), this.isRequired(),
this.getName(), this.getName(),
this.getDefaultValue(), this.getDefaultValue(),
this.getSuggestionsProvider() this.getSuggestionsProvider(),
this.getDefaultDescription()
); );
} }

View file

@ -24,6 +24,7 @@
package cloud.commandframework.fabric.argument; package cloud.commandframework.fabric.argument;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser; import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
import cloud.commandframework.context.CommandContext; import cloud.commandframework.context.CommandContext;
@ -46,7 +47,8 @@ public final class NbtPathArgument<C> extends CommandArgument<C, NbtPathArgument
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription
) { ) {
super( super(
required, required,
@ -54,7 +56,8 @@ public final class NbtPathArgument<C> extends CommandArgument<C, NbtPathArgument
new WrappedBrigadierParser<>(NbtPathArgumentType.nbtPath()), new WrappedBrigadierParser<>(NbtPathArgumentType.nbtPath()),
defaultValue, defaultValue,
NbtPathArgumentType.NbtPath.class, NbtPathArgumentType.NbtPath.class,
suggestionsProvider suggestionsProvider,
defaultDescription
); );
} }
@ -135,7 +138,8 @@ public final class NbtPathArgument<C> extends CommandArgument<C, NbtPathArgument
this.isRequired(), this.isRequired(),
this.getName(), this.getName(),
this.getDefaultValue(), this.getDefaultValue(),
this.getSuggestionsProvider() this.getSuggestionsProvider(),
this.getDefaultDescription()
); );
} }

View file

@ -24,6 +24,7 @@
package cloud.commandframework.fabric.argument; package cloud.commandframework.fabric.argument;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser; import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
import cloud.commandframework.context.CommandContext; import cloud.commandframework.context.CommandContext;
@ -47,7 +48,8 @@ public final class NbtTagArgument<C> extends CommandArgument<C, Tag> {
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription
) { ) {
super( super(
required, required,
@ -55,7 +57,8 @@ public final class NbtTagArgument<C> extends CommandArgument<C, Tag> {
new WrappedBrigadierParser<>(NbtTagArgumentType.nbtTag()), new WrappedBrigadierParser<>(NbtTagArgumentType.nbtTag()),
defaultValue, defaultValue,
Tag.class, Tag.class,
suggestionsProvider suggestionsProvider,
defaultDescription
); );
} }
@ -132,7 +135,13 @@ public final class NbtTagArgument<C> extends CommandArgument<C, Tag> {
*/ */
@Override @Override
public @NonNull NbtTagArgument<C> build() { public @NonNull NbtTagArgument<C> build() {
return new NbtTagArgument<>(this.isRequired(), this.getName(), this.getDefaultValue(), this.getSuggestionsProvider()); return new NbtTagArgument<>(
this.isRequired(),
this.getName(),
this.getDefaultValue(),
this.getSuggestionsProvider(),
this.getDefaultDescription()
);
} }
} }

View file

@ -24,6 +24,7 @@
package cloud.commandframework.fabric.argument; package cloud.commandframework.fabric.argument;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser; import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
import cloud.commandframework.context.CommandContext; import cloud.commandframework.context.CommandContext;
@ -47,7 +48,8 @@ public final class ParticleEffectArgument<C> extends CommandArgument<C, Particle
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription
) { ) {
super( super(
required, required,
@ -55,7 +57,8 @@ public final class ParticleEffectArgument<C> extends CommandArgument<C, Particle
new WrappedBrigadierParser<>(ParticleArgumentType.particle()), new WrappedBrigadierParser<>(ParticleArgumentType.particle()),
defaultValue, defaultValue,
ParticleEffect.class, ParticleEffect.class,
suggestionsProvider suggestionsProvider,
defaultDescription
); );
} }
@ -136,7 +139,8 @@ public final class ParticleEffectArgument<C> extends CommandArgument<C, Particle
this.isRequired(), this.isRequired(),
this.getName(), this.getName(),
this.getDefaultValue(), this.getDefaultValue(),
this.getSuggestionsProvider() this.getSuggestionsProvider(),
this.getDefaultDescription()
); );
} }

View file

@ -24,6 +24,7 @@
package cloud.commandframework.fabric.argument; package cloud.commandframework.fabric.argument;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParseResult;
import cloud.commandframework.arguments.parser.ArgumentParser; import cloud.commandframework.arguments.parser.ArgumentParser;
@ -70,9 +71,18 @@ public class RegistryEntryArgument<C, V> extends CommandArgument<C, V> {
final @NonNull RegistryKey<? extends Registry<V>> registry, final @NonNull RegistryKey<? extends Registry<V>> registry,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @NonNull TypeToken<V> valueType, final @NonNull TypeToken<V> valueType,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription
) { ) {
super(required, name, new RegistryEntryParser<>(registry), defaultValue, valueType, suggestionsProvider); super(
required,
name,
new RegistryEntryParser<>(registry),
defaultValue,
valueType,
suggestionsProvider,
defaultDescription
);
} }
/** /**
@ -312,7 +322,8 @@ public class RegistryEntryArgument<C, V> extends CommandArgument<C, V> {
this.registryIdent, this.registryIdent,
this.getDefaultValue(), this.getDefaultValue(),
this.getValueType(), this.getValueType(),
this.getSuggestionsProvider() this.getSuggestionsProvider(),
this.getDefaultDescription()
); );
} }

View file

@ -24,6 +24,7 @@
package cloud.commandframework.fabric.argument; package cloud.commandframework.fabric.argument;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser; import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
import cloud.commandframework.context.CommandContext; import cloud.commandframework.context.CommandContext;
@ -47,7 +48,8 @@ public final class ScoreboardCriterionArgument<C> extends CommandArgument<C, Sco
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription
) { ) {
super( super(
required, required,
@ -55,7 +57,8 @@ public final class ScoreboardCriterionArgument<C> extends CommandArgument<C, Sco
new WrappedBrigadierParser<>(ObjectiveCriteriaArgumentType.objectiveCriteria()), new WrappedBrigadierParser<>(ObjectiveCriteriaArgumentType.objectiveCriteria()),
defaultValue, defaultValue,
ScoreboardCriterion.class, ScoreboardCriterion.class,
suggestionsProvider suggestionsProvider,
defaultDescription
); );
} }
@ -136,7 +139,8 @@ public final class ScoreboardCriterionArgument<C> extends CommandArgument<C, Sco
this.isRequired(), this.isRequired(),
this.getName(), this.getName(),
this.getDefaultValue(), this.getDefaultValue(),
this.getSuggestionsProvider() this.getSuggestionsProvider(),
this.getDefaultDescription()
); );
} }

View file

@ -24,6 +24,7 @@
package cloud.commandframework.fabric.argument; package cloud.commandframework.fabric.argument;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser; import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
import cloud.commandframework.context.CommandContext; import cloud.commandframework.context.CommandContext;
@ -49,7 +50,8 @@ public final class ScoreboardOperationArgument<C> extends CommandArgument<C, Ope
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription
) { ) {
super( super(
required, required,
@ -57,7 +59,8 @@ public final class ScoreboardOperationArgument<C> extends CommandArgument<C, Ope
new WrappedBrigadierParser<>(OperationArgumentType.operation()), new WrappedBrigadierParser<>(OperationArgumentType.operation()),
defaultValue, defaultValue,
Operation.class, Operation.class,
suggestionsProvider suggestionsProvider,
defaultDescription
); );
} }
@ -121,7 +124,8 @@ public final class ScoreboardOperationArgument<C> extends CommandArgument<C, Ope
this.isRequired(), this.isRequired(),
this.getName(), this.getName(),
this.getDefaultValue(), this.getDefaultValue(),
this.getSuggestionsProvider() this.getSuggestionsProvider(),
this.getDefaultDescription()
); );
} }

View file

@ -24,6 +24,7 @@
package cloud.commandframework.fabric.argument; package cloud.commandframework.fabric.argument;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser; import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
import cloud.commandframework.context.CommandContext; import cloud.commandframework.context.CommandContext;
@ -48,7 +49,8 @@ public final class StatusEffectArgument<C> extends CommandArgument<C, StatusEffe
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription
) { ) {
super( super(
required, required,
@ -56,7 +58,8 @@ public final class StatusEffectArgument<C> extends CommandArgument<C, StatusEffe
new WrappedBrigadierParser<>(MobEffectArgumentType.mobEffect()), new WrappedBrigadierParser<>(MobEffectArgumentType.mobEffect()),
defaultValue, defaultValue,
StatusEffect.class, StatusEffect.class,
suggestionsProvider suggestionsProvider,
defaultDescription
); );
} }
@ -139,7 +142,8 @@ public final class StatusEffectArgument<C> extends CommandArgument<C, StatusEffe
this.isRequired(), this.isRequired(),
this.getName(), this.getName(),
this.getDefaultValue(), this.getDefaultValue(),
this.getSuggestionsProvider() this.getSuggestionsProvider(),
this.getDefaultDescription()
); );
} }

View file

@ -24,6 +24,7 @@
package cloud.commandframework.fabric.argument; package cloud.commandframework.fabric.argument;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParseResult;
import cloud.commandframework.captions.CaptionVariable; import cloud.commandframework.captions.CaptionVariable;
@ -57,7 +58,8 @@ public final class TeamArgument<C> extends CommandArgument<C, Team> {
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription
) { ) {
super( super(
required, required,
@ -65,7 +67,8 @@ public final class TeamArgument<C> extends CommandArgument<C, Team> {
new TeamParser<>(), new TeamParser<>(),
defaultValue, defaultValue,
Team.class, Team.class,
suggestionsProvider suggestionsProvider,
defaultDescription
); );
} }
@ -197,7 +200,13 @@ public final class TeamArgument<C> extends CommandArgument<C, Team> {
*/ */
@Override @Override
public @NonNull TeamArgument<C> build() { public @NonNull TeamArgument<C> build() {
return new TeamArgument<>(this.isRequired(), this.getName(), this.getDefaultValue(), this.getSuggestionsProvider()); return new TeamArgument<>(
this.isRequired(),
this.getName(),
this.getDefaultValue(),
this.getSuggestionsProvider(),
this.getDefaultDescription()
);
} }
} }

View file

@ -24,6 +24,7 @@
package cloud.commandframework.fabric.argument; package cloud.commandframework.fabric.argument;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.context.CommandContext; import cloud.commandframework.context.CommandContext;
import cloud.commandframework.fabric.data.MinecraftTime; import cloud.commandframework.fabric.data.MinecraftTime;
@ -45,7 +46,8 @@ public final class TimeArgument<C> extends CommandArgument<C, MinecraftTime> {
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription
) { ) {
super( super(
required, required,
@ -53,7 +55,8 @@ public final class TimeArgument<C> extends CommandArgument<C, MinecraftTime> {
FabricArgumentParsers.time(), FabricArgumentParsers.time(),
defaultValue, defaultValue,
MinecraftTime.class, MinecraftTime.class,
suggestionsProvider suggestionsProvider,
defaultDescription
); );
} }
@ -130,7 +133,13 @@ public final class TimeArgument<C> extends CommandArgument<C, MinecraftTime> {
*/ */
@Override @Override
public @NonNull TimeArgument<C> build() { public @NonNull TimeArgument<C> build() {
return new TimeArgument<>(this.isRequired(), this.getName(), this.getDefaultValue(), this.getSuggestionsProvider()); return new TimeArgument<>(
this.isRequired(),
this.getName(),
this.getDefaultValue(),
this.getSuggestionsProvider(),
this.getDefaultDescription()
);
} }
} }

View file

@ -23,6 +23,7 @@
// //
package cloud.commandframework.fabric.argument.server; package cloud.commandframework.fabric.argument.server;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.context.CommandContext; import cloud.commandframework.context.CommandContext;
import cloud.commandframework.fabric.argument.FabricArgumentParsers; import cloud.commandframework.fabric.argument.FabricArgumentParsers;
@ -46,7 +47,8 @@ public final class BlockPosArgument<C> extends CommandArgument<C, BlockCoordinat
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription
) { ) {
super( super(
required, required,
@ -54,7 +56,8 @@ public final class BlockPosArgument<C> extends CommandArgument<C, BlockCoordinat
FabricArgumentParsers.blockPos(), FabricArgumentParsers.blockPos(),
defaultValue, defaultValue,
BlockCoordinates.class, BlockCoordinates.class,
suggestionsProvider suggestionsProvider,
defaultDescription
); );
} }
@ -142,7 +145,8 @@ public final class BlockPosArgument<C> extends CommandArgument<C, BlockCoordinat
this.isRequired(), this.isRequired(),
this.getName(), this.getName(),
this.getDefaultValue(), this.getDefaultValue(),
this.getSuggestionsProvider() this.getSuggestionsProvider(),
this.getDefaultDescription()
); );
} }

View file

@ -23,6 +23,7 @@
// //
package cloud.commandframework.fabric.argument.server; package cloud.commandframework.fabric.argument.server;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.context.CommandContext; import cloud.commandframework.context.CommandContext;
import cloud.commandframework.fabric.argument.FabricArgumentParsers; import cloud.commandframework.fabric.argument.FabricArgumentParsers;
@ -46,7 +47,8 @@ public final class ColumnPosArgument<C> extends CommandArgument<C, ColumnCoordin
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription
) { ) {
super( super(
required, required,
@ -54,7 +56,8 @@ public final class ColumnPosArgument<C> extends CommandArgument<C, ColumnCoordin
FabricArgumentParsers.columnPos(), FabricArgumentParsers.columnPos(),
defaultValue, defaultValue,
ColumnCoordinates.class, ColumnCoordinates.class,
suggestionsProvider suggestionsProvider,
defaultDescription
); );
} }
@ -141,7 +144,8 @@ public final class ColumnPosArgument<C> extends CommandArgument<C, ColumnCoordin
this.isRequired(), this.isRequired(),
this.getName(), this.getName(),
this.getDefaultValue(), this.getDefaultValue(),
this.getSuggestionsProvider() this.getSuggestionsProvider(),
this.getDefaultDescription()
); );
} }

View file

@ -24,6 +24,7 @@
package cloud.commandframework.fabric.argument.server; package cloud.commandframework.fabric.argument.server;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.context.CommandContext; import cloud.commandframework.context.CommandContext;
import cloud.commandframework.fabric.argument.FabricArgumentParsers; import cloud.commandframework.fabric.argument.FabricArgumentParsers;
@ -46,7 +47,8 @@ public final class MessageArgument<C> extends CommandArgument<C, Message> {
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription
) { ) {
super( super(
required, required,
@ -54,7 +56,8 @@ public final class MessageArgument<C> extends CommandArgument<C, Message> {
FabricArgumentParsers.message(), FabricArgumentParsers.message(),
defaultValue, defaultValue,
Message.class, Message.class,
suggestionsProvider suggestionsProvider,
defaultDescription
); );
} }
@ -135,7 +138,8 @@ public final class MessageArgument<C> extends CommandArgument<C, Message> {
this.isRequired(), this.isRequired(),
this.getName(), this.getName(),
this.getDefaultValue(), this.getDefaultValue(),
this.getSuggestionsProvider() this.getSuggestionsProvider(),
this.getDefaultDescription()
); );
} }

View file

@ -23,6 +23,7 @@
// //
package cloud.commandframework.fabric.argument.server; package cloud.commandframework.fabric.argument.server;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.context.CommandContext; import cloud.commandframework.context.CommandContext;
import cloud.commandframework.fabric.argument.FabricArgumentParsers; import cloud.commandframework.fabric.argument.FabricArgumentParsers;
@ -45,7 +46,8 @@ public final class MultipleEntitySelectorArgument<C> extends CommandArgument<C,
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription
) { ) {
super( super(
required, required,
@ -53,7 +55,8 @@ public final class MultipleEntitySelectorArgument<C> extends CommandArgument<C,
FabricArgumentParsers.multipleEntitySelector(), FabricArgumentParsers.multipleEntitySelector(),
defaultValue, defaultValue,
MultipleEntitySelector.class, MultipleEntitySelector.class,
suggestionsProvider suggestionsProvider,
defaultDescription
); );
} }
@ -117,7 +120,8 @@ public final class MultipleEntitySelectorArgument<C> extends CommandArgument<C,
this.isRequired(), this.isRequired(),
this.getName(), this.getName(),
this.getDefaultValue(), this.getDefaultValue(),
this.getSuggestionsProvider() this.getSuggestionsProvider(),
this.getDefaultDescription()
); );
} }

View file

@ -23,6 +23,7 @@
// //
package cloud.commandframework.fabric.argument.server; package cloud.commandframework.fabric.argument.server;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.context.CommandContext; import cloud.commandframework.context.CommandContext;
import cloud.commandframework.fabric.argument.FabricArgumentParsers; import cloud.commandframework.fabric.argument.FabricArgumentParsers;
@ -45,7 +46,8 @@ public final class MultiplePlayerSelectorArgument<C> extends CommandArgument<C,
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription
) { ) {
super( super(
required, required,
@ -53,7 +55,8 @@ public final class MultiplePlayerSelectorArgument<C> extends CommandArgument<C,
FabricArgumentParsers.multiplePlayerSelector(), FabricArgumentParsers.multiplePlayerSelector(),
defaultValue, defaultValue,
MultiplePlayerSelector.class, MultiplePlayerSelector.class,
suggestionsProvider suggestionsProvider,
defaultDescription
); );
} }
@ -117,7 +120,8 @@ public final class MultiplePlayerSelectorArgument<C> extends CommandArgument<C,
this.isRequired(), this.isRequired(),
this.getName(), this.getName(),
this.getDefaultValue(), this.getDefaultValue(),
this.getSuggestionsProvider() this.getSuggestionsProvider(),
this.getDefaultDescription()
); );
} }

View file

@ -23,6 +23,7 @@
// //
package cloud.commandframework.fabric.argument.server; package cloud.commandframework.fabric.argument.server;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.context.CommandContext; import cloud.commandframework.context.CommandContext;
import cloud.commandframework.fabric.argument.FabricArgumentParsers; import cloud.commandframework.fabric.argument.FabricArgumentParsers;
@ -45,7 +46,8 @@ public final class SingleEntitySelectorArgument<C> extends CommandArgument<C, Si
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription
) { ) {
super( super(
required, required,
@ -53,7 +55,8 @@ public final class SingleEntitySelectorArgument<C> extends CommandArgument<C, Si
FabricArgumentParsers.singleEntitySelector(), FabricArgumentParsers.singleEntitySelector(),
defaultValue, defaultValue,
SingleEntitySelector.class, SingleEntitySelector.class,
suggestionsProvider suggestionsProvider,
defaultDescription
); );
} }
@ -117,7 +120,8 @@ public final class SingleEntitySelectorArgument<C> extends CommandArgument<C, Si
this.isRequired(), this.isRequired(),
this.getName(), this.getName(),
this.getDefaultValue(), this.getDefaultValue(),
this.getSuggestionsProvider() this.getSuggestionsProvider(),
this.getDefaultDescription()
); );
} }

View file

@ -23,6 +23,7 @@
// //
package cloud.commandframework.fabric.argument.server; package cloud.commandframework.fabric.argument.server;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.context.CommandContext; import cloud.commandframework.context.CommandContext;
import cloud.commandframework.fabric.argument.FabricArgumentParsers; import cloud.commandframework.fabric.argument.FabricArgumentParsers;
@ -45,7 +46,8 @@ public final class SinglePlayerSelectorArgument<C> extends CommandArgument<C, Si
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription
) { ) {
super( super(
required, required,
@ -53,7 +55,8 @@ public final class SinglePlayerSelectorArgument<C> extends CommandArgument<C, Si
FabricArgumentParsers.singlePlayerSelector(), FabricArgumentParsers.singlePlayerSelector(),
defaultValue, defaultValue,
SinglePlayerSelector.class, SinglePlayerSelector.class,
suggestionsProvider suggestionsProvider,
defaultDescription
); );
} }
@ -117,7 +120,8 @@ public final class SinglePlayerSelectorArgument<C> extends CommandArgument<C, Si
this.isRequired(), this.isRequired(),
this.getName(), this.getName(),
this.getDefaultValue(), this.getDefaultValue(),
this.getSuggestionsProvider() this.getSuggestionsProvider(),
this.getDefaultDescription()
); );
} }

View file

@ -23,6 +23,7 @@
// //
package cloud.commandframework.fabric.argument.server; package cloud.commandframework.fabric.argument.server;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.context.CommandContext; import cloud.commandframework.context.CommandContext;
import cloud.commandframework.fabric.argument.FabricArgumentParsers; import cloud.commandframework.fabric.argument.FabricArgumentParsers;
@ -49,6 +50,7 @@ public final class Vec2Argument<C> extends CommandArgument<C, Coordinates.Coordi
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider, final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription,
final boolean centerIntegers final boolean centerIntegers
) { ) {
super( super(
@ -57,7 +59,8 @@ public final class Vec2Argument<C> extends CommandArgument<C, Coordinates.Coordi
FabricArgumentParsers.vec2(centerIntegers), FabricArgumentParsers.vec2(centerIntegers),
defaultValue, defaultValue,
Coordinates.CoordinatesXZ.class, Coordinates.CoordinatesXZ.class,
suggestionsProvider suggestionsProvider,
defaultDescription
); );
this.centerIntegers = centerIntegers; this.centerIntegers = centerIntegers;
} }
@ -227,6 +230,7 @@ public final class Vec2Argument<C> extends CommandArgument<C, Coordinates.Coordi
this.getName(), this.getName(),
this.getDefaultValue(), this.getDefaultValue(),
this.getSuggestionsProvider(), this.getSuggestionsProvider(),
this.getDefaultDescription(),
this.centerIntegers() this.centerIntegers()
); );
} }

View file

@ -23,6 +23,7 @@
// //
package cloud.commandframework.fabric.argument.server; package cloud.commandframework.fabric.argument.server;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.CommandArgument;
import cloud.commandframework.context.CommandContext; import cloud.commandframework.context.CommandContext;
import cloud.commandframework.fabric.argument.FabricArgumentParsers; import cloud.commandframework.fabric.argument.FabricArgumentParsers;
@ -49,6 +50,7 @@ public final class Vec3Argument<C> extends CommandArgument<C, Coordinates> {
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue, final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider, final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription,
final boolean centerIntegers final boolean centerIntegers
) { ) {
super( super(
@ -57,7 +59,8 @@ public final class Vec3Argument<C> extends CommandArgument<C, Coordinates> {
FabricArgumentParsers.vec3(centerIntegers), FabricArgumentParsers.vec3(centerIntegers),
defaultValue, defaultValue,
Coordinates.class, Coordinates.class,
suggestionsProvider suggestionsProvider,
defaultDescription
); );
this.centerIntegers = centerIntegers; this.centerIntegers = centerIntegers;
} }
@ -228,6 +231,7 @@ public final class Vec3Argument<C> extends CommandArgument<C, Coordinates> {
this.getName(), this.getName(),
this.getDefaultValue(), this.getDefaultValue(),
this.getSuggestionsProvider(), this.getSuggestionsProvider(),
this.getDefaultDescription(),
this.centerIntegers() this.centerIntegers()
); );
} }

View file

@ -56,6 +56,7 @@ public final class PlayerArgument<C> extends CommandArgument<C, Player> {
private PlayerArgument( private PlayerArgument(
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider, final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription, final @NonNull ArgumentDescription defaultDescription,
final @NonNull Collection<@NonNull BiFunction<@NonNull CommandContext<C>, @NonNull Queue<@NonNull String>, 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, required,
name, name,
new PlayerParser<>(), new PlayerParser<>(),
"", defaultValue,
TypeToken.get(Player.class), TypeToken.get(Player.class),
suggestionsProvider, suggestionsProvider,
defaultDescription, defaultDescription,
@ -128,6 +129,7 @@ public final class PlayerArgument<C> extends CommandArgument<C, Player> {
return new PlayerArgument<>( return new PlayerArgument<>(
this.isRequired(), this.isRequired(),
this.getName(), this.getName(),
this.getDefaultValue(),
this.getSuggestionsProvider(), this.getSuggestionsProvider(),
this.getDefaultDescription(), this.getDefaultDescription(),
new LinkedList<>() new LinkedList<>()

View file

@ -56,6 +56,7 @@ public final class ServerArgument<C> extends CommandArgument<C, RegisteredServer
private ServerArgument( private ServerArgument(
final boolean required, final boolean required,
final @NonNull String name, final @NonNull String name,
final @NonNull String defaultValue,
final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider, final @Nullable BiFunction<CommandContext<C>, String, List<String>> suggestionsProvider,
final @NonNull ArgumentDescription defaultDescription, final @NonNull ArgumentDescription defaultDescription,
final @NonNull Collection<@NonNull BiFunction<@NonNull CommandContext<C>, @NonNull Queue<@NonNull String>, 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, required,
name, name,
new ServerParser<>(), new ServerParser<>(),
"", defaultValue,
TypeToken.get(RegisteredServer.class), TypeToken.get(RegisteredServer.class),
suggestionsProvider, suggestionsProvider,
defaultDescription, defaultDescription,
@ -125,6 +126,7 @@ public final class ServerArgument<C> extends CommandArgument<C, RegisteredServer
return new ServerArgument<>( return new ServerArgument<>(
this.isRequired(), this.isRequired(),
this.getName(), this.getName(),
this.getDefaultValue(),
this.getSuggestionsProvider(), this.getSuggestionsProvider(),
this.getDefaultDescription(), this.getDefaultDescription(),
new LinkedList<>() new LinkedList<>()