Class MultiplePlayerSelectorParser<C>
java.lang.Object
org.incendo.cloud.bukkit.parser.selector.MultiplePlayerSelectorParser<C>
- Type Parameters:
C- sender type
- All Implemented Interfaces:
ArgumentParser<C,,MultiplePlayerSelector> ArgumentParser.FutureArgumentParser<C,,MultiplePlayerSelector> SuggestionProvider<C>,SuggestionProviderHolder<C>
Parser for
MultiplePlayerSelector. On Minecraft 1.13+
this argument uses Minecraft's built-in entity selector argument for parsing
and suggestions. On prior versions, this argument behaves similarly to
PlayerParser.-
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
ConstructorsConstructorDescriptionCreates a newMultiplePlayerSelectorParser.MultiplePlayerSelectorParser(boolean allowEmpty) Creates a newMultiplePlayerSelectorParser. -
Method Summary
Modifier and TypeMethodDescriptionlegacyParse(@NonNull CommandContext<C> commandContext, @NonNull 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) static <C> @NonNull CommandComponent.Builder<C, MultiplePlayerSelector> Returns aCommandComponent.BuilderusingmultiplePlayerSelectorParser()as the parser.static <C> @NonNull ParserDescriptor<C, MultiplePlayerSelector> Creates a new multiple player selector parser that allows empty results.static <C> @NonNull ParserDescriptor<C, MultiplePlayerSelector> multiplePlayerSelectorParser(boolean allowEmpty) Creates a new multiple player selector parser.parseFuture(CommandContext<C> commandContext, CommandInput commandInput) 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
-
MultiplePlayerSelectorParser
Creates a newMultiplePlayerSelectorParser.- Parameters:
allowEmpty- Whether to allow an empty result- Since:
- 1.8.0
-
MultiplePlayerSelectorParser
public MultiplePlayerSelectorParser()Creates a newMultiplePlayerSelectorParser.
-
-
Method Details
-
multiplePlayerSelectorParser
@API(status=STABLE, since="2.0.0") public static <C> @NonNull ParserDescriptor<C,MultiplePlayerSelector> multiplePlayerSelectorParser()Creates a new multiple player selector parser that allows empty results.- Type Parameters:
C- command sender type- Returns:
- the created parser
- Since:
- 2.0.0
-
multiplePlayerSelectorParser
@API(status=STABLE, since="2.0.0") public static <C> @NonNull ParserDescriptor<C,MultiplePlayerSelector> multiplePlayerSelectorParser(boolean allowEmpty) Creates a new multiple player selector parser.- Type Parameters:
C- command sender type- Parameters:
allowEmpty- whether to allow empty selections- Returns:
- the created parser
- Since:
- 2.0.0
-
multiplePlayerSelectorComponent
@API(status=STABLE, since="2.0.0") public static <C> @NonNull CommandComponent.Builder<C,MultiplePlayerSelector> multiplePlayerSelectorComponent()Returns aCommandComponent.BuilderusingmultiplePlayerSelectorParser()as the parser.- Type Parameters:
C- the command sender type- Returns:
- the component builder
- Since:
- 2.0.0
-
mapResult
-
legacyParse
protected @NonNull CompletableFuture<ArgumentParseResult<MultiplePlayerSelector>> legacyParse(@NonNull CommandContext<C> commandContext, @NonNull CommandInput commandInput) -
legacySuggestions
protected @NonNull Iterable<@NonNull Suggestion> legacySuggestions(CommandContext<C> commandContext, CommandInput input) -
parseFuture
public CompletableFuture<ArgumentParseResult<MultiplePlayerSelector>> 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>
-