Package org.incendo.cloud.bukkit.parser
Class ItemStackPredicateParser<C>
java.lang.Object
org.incendo.cloud.bukkit.parser.ItemStackPredicateParser<C>
- Type Parameters:
C- Command sender type
- All Implemented Interfaces:
ArgumentParser<C,,ItemStackPredicate> ArgumentParser.FutureArgumentParser<C,,ItemStackPredicate> SuggestionProviderHolder<C>
public final class ItemStackPredicateParser<C>
extends Object
implements ArgumentParser.FutureArgumentParser<C,ItemStackPredicate>
Parser for
ItemStackPredicate.
This argument type is only usable on Minecraft 1.13+, as it depends on Minecraft internals added in that version.
This argument type only provides basic suggestions by default. Enabling Brigadier compatibility through
BukkitCommandManager.registerBrigadier() will allow client side validation and suggestions to be utilized.
- Since:
- 1.5.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.incendo.cloud.parser.ArgumentParser
ArgumentParser.FutureArgumentParser<C,T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <C> @NonNull CommandComponent.Builder<C, ItemStackPredicate> Returns aCommandComponent.BuilderusingitemStackPredicateParser()as the parser.static <C> @NonNull ParserDescriptor<C, ItemStackPredicate> Creates a new item stack predicate parser.parseFuture(@NonNull CommandContext<@NonNull C> commandContext, @NonNull CommandInput commandInput) 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, mapSuccessMethods inherited from interface org.incendo.cloud.parser.ArgumentParser.FutureArgumentParser
parse
-
Constructor Details
-
ItemStackPredicateParser
public ItemStackPredicateParser()Create a newItemStackPredicateParser.- Since:
- 1.5.0
-
-
Method Details
-
itemStackPredicateParser
@API(status=STABLE, since="2.0.0") public static <C> @NonNull ParserDescriptor<C,ItemStackPredicate> itemStackPredicateParser()Creates a new item stack predicate parser.- Type Parameters:
C- command sender type- Returns:
- the created parser
- Since:
- 2.0.0
-
itemStackPredicateComponent
@API(status=STABLE, since="2.0.0") public static <C> @NonNull CommandComponent.Builder<C,ItemStackPredicate> itemStackPredicateComponent()Returns aCommandComponent.BuilderusingitemStackPredicateParser()as the parser.- Type Parameters:
C- the command sender type- Returns:
- the component builder
- Since:
- 2.0.0
-
parseFuture
public @NonNull CompletableFuture<ArgumentParseResult<@NonNull ItemStackPredicate>> parseFuture(@NonNull CommandContext<@NonNull C> commandContext, @NonNull CommandInput commandInput) - Specified by:
parseFuturein interfaceArgumentParser<C,ItemStackPredicate> - Specified by:
parseFuturein interfaceArgumentParser.FutureArgumentParser<C,ItemStackPredicate>
-
suggestionProvider
- Specified by:
suggestionProviderin interfaceArgumentParser<C,ItemStackPredicate> - Specified by:
suggestionProviderin interfaceSuggestionProviderHolder<C>
-