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:
org.incendo.cloud.parser.ArgumentParser<C,,T> org.incendo.cloud.suggestion.SuggestionProvider<C>,org.incendo.cloud.suggestion.SuggestionProviderHolder<C>
public class WrappedBrigadierParser<C,T>
extends Object
implements org.incendo.cloud.parser.ArgumentParser<C,T>, org.incendo.cloud.suggestion.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. -
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 org.incendo.cloud.parser.ArgumentParseResult<@NonNull T>parse(@NonNull org.incendo.cloud.context.CommandContext<@NonNull C> commandContext, @NonNull org.incendo.cloud.context.CommandInput commandInput) final @NonNull CompletableFuture<@NonNull Iterable<@NonNull org.incendo.cloud.suggestion.Suggestion>>suggestionsFuture(@NonNull org.incendo.cloud.context.CommandContext<C> commandContext, @NonNull org.incendo.cloud.context.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
-
suggestionsFuture
public final @NonNull CompletableFuture<@NonNull Iterable<@NonNull org.incendo.cloud.suggestion.Suggestion>> suggestionsFuture(@NonNull org.incendo.cloud.context.CommandContext<C> commandContext, @NonNull org.incendo.cloud.context.CommandInput input) - Specified by:
suggestionsFuturein interfaceorg.incendo.cloud.suggestion.SuggestionProvider<C>
-