Class TeamParser<C>
java.lang.Object
org.incendo.cloud.minecraft.modded.parser.TeamParser<C>
- Type Parameters:
C- the sender type
- All Implemented Interfaces:
ArgumentParser<C, net.minecraft.world.scores.PlayerTeam>, ArgumentParser.FutureArgumentParser<C, net.minecraft.world.scores.PlayerTeam>, BlockingSuggestionProvider<C>, BlockingSuggestionProvider.Strings<C>, SuggestionProvider<C>, SuggestionProviderHolder<C>
An argument for parsing
Teams.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classException for when a team cannot be found for supplied input.Nested classes/interfaces inherited from interface ArgumentParser
ArgumentParser.FutureArgumentParser<C,T> Nested classes/interfaces inherited from interface BlockingSuggestionProvider
BlockingSuggestionProvider.Strings<C> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected @NonNull ArgumentParser.FutureArgumentParser<C, String> @NonNull CompletableFuture<@NonNull ArgumentParseResult<net.minecraft.world.scores.PlayerTeam>> parseFuture(@NonNull CommandContext<C> commandContext, @NonNull CommandInput commandInput) protected @NonNull CompletableFuture<@NonNull ArgumentParseResult<net.minecraft.world.scores.PlayerTeam>> resolveClient(@NonNull CommandContext<C> context, @NonNull String value) Resolve the final value for this argument when running on the client.protected @NonNull CompletableFuture<@NonNull ArgumentParseResult<net.minecraft.world.scores.PlayerTeam>> resolveServer(@NonNull CommandContext<C> context, @NonNull String value) Resolve the final value for this argument when running on the server.stringSuggestions(@NonNull CommandContext<C> commandContext, @NonNull CommandInput input) static <C> @NonNull CommandComponent.Builder<C, net.minecraft.world.scores.PlayerTeam> Returns aCommandComponent.BuilderusingteamParser()as the parser.static <C> @NonNull ParserDescriptor<C, net.minecraft.world.scores.PlayerTeam> Creates a new server parser.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ArgumentParser
flatMap, flatMapSuccess, mapSuccess, suggestionProviderMethods inherited from interface ArgumentParser.FutureArgumentParser
parseMethods inherited from interface BlockingSuggestionProvider
suggestionsFutureMethods inherited from interface BlockingSuggestionProvider.Strings
suggestions
-
Constructor Details
-
TeamParser
public TeamParser()
-
-
Method Details
-
teamParser
Creates a new server parser.- Type Parameters:
C- command sender type- Returns:
- the created parser
-
teamComponent
public static <C> @NonNull CommandComponent.Builder<C, net.minecraft.world.scores.PlayerTeam> teamComponent()Returns aCommandComponent.BuilderusingteamParser()as the parser.- Type Parameters:
C- the command sender type- Returns:
- the component builder
-
stringSuggestions
public @NonNull Iterable<@NonNull String> stringSuggestions(@NonNull CommandContext<C> commandContext, @NonNull CommandInput input) - Specified by:
stringSuggestionsin interfaceBlockingSuggestionProvider.Strings<C>
-
intermediateParser
-
resolveClient
protected @NonNull CompletableFuture<@NonNull ArgumentParseResult<net.minecraft.world.scores.PlayerTeam>> resolveClient(@NonNull CommandContext<C> context, @NonNull String value) Resolve the final value for this argument when running on the client.- Parameters:
context- Command contextvalue- parsed intermediate value- Returns:
- a resolved value
-
resolveServer
protected @NonNull CompletableFuture<@NonNull ArgumentParseResult<net.minecraft.world.scores.PlayerTeam>> resolveServer(@NonNull CommandContext<C> context, @NonNull String value) Resolve the final value for this argument when running on the server.- Parameters:
context- Command contextvalue- Parsed intermediate value- Returns:
- a resolved value
-
parseFuture
public @NonNull CompletableFuture<@NonNull ArgumentParseResult<net.minecraft.world.scores.PlayerTeam>> parseFuture(@NonNull CommandContext<C> commandContext, @NonNull CommandInput commandInput) - Specified by:
parseFuturein interfaceArgumentParser<C, IntermediateType>- Specified by:
parseFuturein interfaceArgumentParser.FutureArgumentParser<C, IntermediateType>
-