Class TextColorParser<C>
java.lang.Object
org.incendo.cloud.minecraft.extras.parser.TextColorParser<C>
- Type Parameters:
C- Command sender type
- All Implemented Interfaces:
ArgumentParser<C,,TextColor> BlockingSuggestionProvider<C>,BlockingSuggestionProvider.Strings<C>,SuggestionProvider<C>,SuggestionProviderHolder<C>
public final class TextColorParser<C>
extends Object
implements ArgumentParser<C,TextColor>, BlockingSuggestionProvider.Strings<C>
Parser for color codes.
Accepts NamedTextColors, Legacy Minecraft & color codes, and Hex Codes (#RRGGBB or RRGGBB)
- Since:
- 1.1.0
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.incendo.cloud.parser.ArgumentParser
ArgumentParser.FutureArgumentParser<C,T> Nested classes/interfaces inherited from interface org.incendo.cloud.suggestion.BlockingSuggestionProvider
BlockingSuggestionProvider.Strings<C> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionparse(@NonNull CommandContext<@NonNull C> commandContext, @NonNull CommandInput commandInput) stringSuggestions(@NonNull CommandContext<C> commandContext, @NonNull CommandInput input) static <C> @NonNull CommandComponent.Builder<C, TextColor> Returns aCommandComponent.BuilderusingtextColorParser()as the parser.static <C> @NonNull ParserDescriptor<C, TextColor> Creates a new text color parser.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, suggestionProviderMethods inherited from interface org.incendo.cloud.suggestion.BlockingSuggestionProvider
suggestionsFutureMethods inherited from interface org.incendo.cloud.suggestion.BlockingSuggestionProvider.Strings
suggestions
-
Constructor Details
-
TextColorParser
public TextColorParser()
-
-
Method Details
-
textColorParser
@API(status=STABLE, since="2.0.0") public static <C> @NonNull ParserDescriptor<C,TextColor> textColorParser()Creates a new text color parser.- Type Parameters:
C- command sender type- Returns:
- the created parser
- Since:
- 2.0.0
-
textColorComponent
@API(status=STABLE, since="2.0.0") public static <C> @NonNull CommandComponent.Builder<C,TextColor> textColorComponent()Returns aCommandComponent.BuilderusingtextColorParser()as the parser.- Type Parameters:
C- the command sender type- Returns:
- the component builder
- Since:
- 2.0.0
-
parse
public @NonNull ArgumentParseResult<@NonNull TextColor> parse(@NonNull CommandContext<@NonNull C> commandContext, @NonNull CommandInput commandInput) - Specified by:
parsein interfaceArgumentParser<C,TextColor>
-
stringSuggestions
public @NonNull Iterable<@NonNull String> stringSuggestions(@NonNull CommandContext<C> commandContext, @NonNull CommandInput input) - Specified by:
stringSuggestionsin interfaceBlockingSuggestionProvider.Strings<C>
-