Class WrappedBrigadierParser<C,T>
java.lang.Object
org.incendo.cloud.brigadier.parser.WrappedBrigadierParser<C,T>
- Type Parameters:
C- command sender typeT- value type
- All Implemented Interfaces:
ArgumentParser<C,,T> SuggestionProvider<C>,SuggestionProviderHolder<C>
public class WrappedBrigadierParser<C,T>
extends Object
implements ArgumentParser<C,T>, SuggestionProvider<C>
A wrapped
argument parser adapting Brigadier argument types.- Since:
- 1.5.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFunction which can callArgumentType.parse(StringReader)or another method.Nested classes/interfaces inherited from interface org.incendo.cloud.parser.ArgumentParser
ArgumentParser.FutureArgumentParser<C extends Object,T extends Object> -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWrappedBrigadierParser(com.mojang.brigadier.arguments.ArgumentType<T> argumentType) Create anargument parserfrom a BrigadierArgumentType.WrappedBrigadierParser(Supplier<com.mojang.brigadier.arguments.ArgumentType<T>> argumentTypeSupplier) Create aWrappedBrigadierParserfor theargument type.WrappedBrigadierParser(Supplier<com.mojang.brigadier.arguments.ArgumentType<T>> argumentTypeSupplier, @Nullable WrappedBrigadierParser.ParseFunction<T> parse) Create anargument parserfrom a BrigadierArgumentType. -
Method Summary
Modifier and TypeMethodDescriptionfinal com.mojang.brigadier.arguments.ArgumentType<T>Returns the backing BrigadierArgumentTypefor this parser.final @NonNull ArgumentParseResult<@NonNull T>parse(@NonNull CommandContext<@NonNull C> commandContext, @NonNull CommandInput commandInput) 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, parseFuture, suggestionProvider
-
Field Details
-
COMMAND_CONTEXT_BRIGADIER_NATIVE_SENDER
- See Also:
-
-
Constructor Details
-
WrappedBrigadierParser
Create anargument parserfrom a BrigadierArgumentType.- Parameters:
argumentType- Brigadier argument type- Since:
- 1.5.0
-
WrappedBrigadierParser
public WrappedBrigadierParser(Supplier<com.mojang.brigadier.arguments.ArgumentType<T>> argumentTypeSupplier) Create aWrappedBrigadierParserfor theargument type.- Parameters:
argumentTypeSupplier- Brigadier argument type supplier- Since:
- 1.7.0
-
WrappedBrigadierParser
@API(status=STABLE, since="2.0.0") public WrappedBrigadierParser(Supplier<com.mojang.brigadier.arguments.ArgumentType<T>> argumentTypeSupplier, @Nullable WrappedBrigadierParser.ParseFunction<T> parse) Create anargument parserfrom a BrigadierArgumentType.- Parameters:
argumentTypeSupplier- Brigadier argument type supplierparse- special function to replaceArgumentType.parse(StringReader)(for CraftBukkit weirdness)- Since:
- 2.0.0
-
-
Method Details
-
nativeArgumentType
Returns the backing BrigadierArgumentTypefor this parser.- Returns:
- the argument type
- Since:
- 1.5.0
-
parse
public final @NonNull ArgumentParseResult<@NonNull T> parse(@NonNull CommandContext<@NonNull C> commandContext, @NonNull CommandInput commandInput) - Specified by:
parsein interfaceArgumentParser<C,T>
-
suggestionsFuture
public final @NonNull CompletableFuture<@NonNull Iterable<@NonNull Suggestion>> suggestionsFuture(@NonNull CommandContext<C> commandContext, @NonNull CommandInput input) - Specified by:
suggestionsFuturein interfaceSuggestionProvider<C>
-