Package org.incendo.cloud.bukkit.parser
Class BlockPredicateParser<C>
java.lang.Object
org.incendo.cloud.bukkit.parser.BlockPredicateParser<C>
- Type Parameters:
C- Command sender type
- All Implemented Interfaces:
ArgumentParser<C,,BlockPredicate> ArgumentParser.FutureArgumentParser<C,,BlockPredicate> SuggestionProviderHolder<C>
public final class BlockPredicateParser<C>
extends Object
implements ArgumentParser.FutureArgumentParser<C,BlockPredicate>
Parser for
BlockPredicate.
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, BlockPredicate> Returns aCommandComponent.BuilderusingblockPredicateParser()as the parser.static <C> @NonNull ParserDescriptor<C, BlockPredicate> Creates a block 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
-
BlockPredicateParser
public BlockPredicateParser()Create a newBlockPredicateParser.- Since:
- 1.5.0
-
-
Method Details
-
blockPredicateParser
@API(status=STABLE, since="2.0.0") public static <C> @NonNull ParserDescriptor<C,BlockPredicate> blockPredicateParser()Creates a block predicate parser.- Type Parameters:
C- command sender type- Returns:
- the created parser
- Since:
- 2.0.0
-
blockPredicateComponent
@API(status=STABLE, since="2.0.0") public static <C> @NonNull CommandComponent.Builder<C,BlockPredicate> blockPredicateComponent()Returns aCommandComponent.BuilderusingblockPredicateParser()as the parser.- Type Parameters:
C- the command sender type- Returns:
- the component builder
- Since:
- 2.0.0
-
parseFuture
public @NonNull CompletableFuture<ArgumentParseResult<@NonNull BlockPredicate>> parseFuture(@NonNull CommandContext<@NonNull C> commandContext, @NonNull CommandInput commandInput) - Specified by:
parseFuturein interfaceArgumentParser<C,BlockPredicate> - Specified by:
parseFuturein interfaceArgumentParser.FutureArgumentParser<C,BlockPredicate>
-
suggestionProvider
- Specified by:
suggestionProviderin interfaceArgumentParser<C,BlockPredicate> - Specified by:
suggestionProviderin interfaceSuggestionProviderHolder<C>
-