Interface BrigadierMappingBuilder<K extends ArgumentParser<?,?>,S>
- Type Parameters:
K- the Cloud argument parser typeS- the brigadier-native sender type
public interface BrigadierMappingBuilder<K extends ArgumentParser<?,?>,S>
A builder for a mapping between a Cloud parser and a Brigadier
ArgumentType- Since:
- 1.5.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceBrigadierMappingBuilder.SuggestionProviderSupplier<K extends ArgumentParser<?,?>, S> -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the mapping.Use the suggestions from Cloud's parser for this argument type.Use the default brigadier suggestions for this argument type.Use a custom Brigadier suggestion provider for this parser.default @NonNull BrigadierMappingBuilder<K, S> suggestedByConstant(com.mojang.brigadier.suggestion.SuggestionProvider<S> provider) Use a custom Brigadier suggestion provider for this parser.Map the cloud argument parser to a variable BrigadierArgumentType.toConstant(com.mojang.brigadier.arguments.ArgumentType<?> constant) Map the argument type parser to a constant Brigadier argument type instance.
-
Method Details
-
toConstant
@NonNull BrigadierMappingBuilder<K,S> toConstant(com.mojang.brigadier.arguments.ArgumentType<?> constant) Map the argument type parser to a constant Brigadier argument type instance.- Parameters:
constant- the argument type- Returns:
- this builder
- Since:
- 1.5.0
-
to
@NonNull BrigadierMappingBuilder<K,S> to(Function<K, ? extends com.mojang.brigadier.arguments.ArgumentType<?>> mapper) Map the cloud argument parser to a variable BrigadierArgumentType.- Parameters:
mapper- the mapper- Returns:
- this builder
- Since:
- 1.5.0
-
nativeSuggestions
@NonNull BrigadierMappingBuilder<K,S> nativeSuggestions()Use the default brigadier suggestions for this argument type.This is the default option if a mapped type is specified.
- Returns:
- this builder
- Since:
- 1.5.0
-
cloudSuggestions
@NonNull BrigadierMappingBuilder<K,S> cloudSuggestions()Use the suggestions from Cloud's parser for this argument type.This is not the default suggestions configuration.
Any previously set suggestion provider suppliers will not be used.
- Returns:
- this builder
- Since:
- 1.5.0
-
suggestedByConstant
default @NonNull BrigadierMappingBuilder<K,S> suggestedByConstant(com.mojang.brigadier.suggestion.SuggestionProvider<S> provider) Use a custom Brigadier suggestion provider for this parser.- Parameters:
provider- the suggestion provider- Returns:
- this builder
- Since:
- 1.5.0
-
suggestedBy
@NonNull BrigadierMappingBuilder<K,S> suggestedBy(BrigadierMappingBuilder.SuggestionProviderSupplier<K, S> provider) Use a custom Brigadier suggestion provider for this parser.- Parameters:
provider- the suggestion provider- Returns:
- this builder
- Since:
- 1.5.0
-
build
@NonNull BrigadierMapping<?,K, build()S> Builds the mapping.- Returns:
- the built mapping
- Since:
- 2.0.0
-