Class SingleEntitySelectorParser<C>
java.lang.Object
org.incendo.cloud.bukkit.parser.selector.SingleEntitySelectorParser<C>
- Type Parameters:
C- sender type
- All Implemented Interfaces:
ArgumentParser<C,,SingleEntitySelector> ArgumentParser.FutureArgumentParser<C,,SingleEntitySelector> SuggestionProvider<C>,SuggestionProviderHolder<C>
Parser for
SingleEntitySelector. On Minecraft 1.13+
this argument uses Minecraft's built-in entity selector argument for parsing
and suggestions. On prior versions, this argument will suggest nothing and
always fail parsing with SelectorUnsupportedException.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final classorg.incendo.cloud.bukkit.parser.selector.SelectorUtils.SelectorParser.ThrowerNested classes/interfaces inherited from interface org.incendo.cloud.parser.ArgumentParser
ArgumentParser.FutureArgumentParser<C,T> -
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CompletableFuture<ArgumentParseResult<SingleEntitySelector>> legacyParse(CommandContext<C> commandContext, CommandInput commandInput) protected @NonNull Iterable<@NonNull Suggestion> legacySuggestions(CommandContext<C> commandContext, CommandInput input) mapResult(@NonNull String input, @NonNull org.incendo.cloud.bukkit.parser.selector.SelectorUtils.EntitySelectorWrapper wrapper) parseFuture(CommandContext<C> commandContext, CommandInput commandInput) static <C> @NonNull CommandComponent.Builder<C, SingleEntitySelector> Returns aCommandComponent.BuilderusingsingleEntitySelectorParser()as the parser.static <C> @NonNull ParserDescriptor<C, SingleEntitySelector> Creates a new single entity selector parser.CompletableFuture<? extends @NonNull Iterable<? extends @NonNull Suggestion>> suggestionsFuture(@NonNull CommandContext<C> commandContext, @NonNull CommandInput input) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.incendo.cloud.parser.ArgumentParser
flatMap, flatMapSuccess, mapSuccess, suggestionProviderMethods inherited from interface org.incendo.cloud.parser.ArgumentParser.FutureArgumentParser
parse
-
Field Details
-
NO_PLAYERS_EXCEPTION_TYPE
-
NO_ENTITIES_EXCEPTION_TYPE
-
-
Constructor Details
-
SingleEntitySelectorParser
public SingleEntitySelectorParser()Creates a newSingleEntitySelectorParser.
-
-
Method Details
-
singleEntitySelectorParser
@API(status=STABLE, since="2.0.0") public static <C> @NonNull ParserDescriptor<C,SingleEntitySelector> singleEntitySelectorParser()Creates a new single entity selector parser.- Type Parameters:
C- command sender type- Returns:
- the created parser
- Since:
- 2.0.0
-
singleEntitySelectorComponent
@API(status=STABLE, since="2.0.0") public static <C> @NonNull CommandComponent.Builder<C,SingleEntitySelector> singleEntitySelectorComponent()Returns aCommandComponent.BuilderusingsingleEntitySelectorParser()as the parser.- Type Parameters:
C- the command sender type- Returns:
- the component builder
- Since:
- 2.0.0
-
mapResult
-
legacyParse
protected CompletableFuture<ArgumentParseResult<SingleEntitySelector>> legacyParse(CommandContext<C> commandContext, CommandInput commandInput) -
legacySuggestions
protected @NonNull Iterable<@NonNull Suggestion> legacySuggestions(CommandContext<C> commandContext, CommandInput input) -
parseFuture
public CompletableFuture<ArgumentParseResult<SingleEntitySelector>> parseFuture(CommandContext<C> commandContext, CommandInput commandInput) - Specified by:
parseFuturein interfaceArgumentParser<C,T> - Specified by:
parseFuturein interfaceArgumentParser.FutureArgumentParser<C,T>
-
suggestionsFuture
public CompletableFuture<? extends @NonNull Iterable<? extends @NonNull Suggestion>> suggestionsFuture(@NonNull CommandContext<C> commandContext, @NonNull CommandInput input) - Specified by:
suggestionsFuturein interfaceSuggestionProvider<C>
-