Class BrigadierMapping<C,K extends ArgumentParser<C,?>,S>
java.lang.Object
org.incendo.cloud.brigadier.argument.BrigadierMapping<C,K,S>
-
Method Summary
Modifier and TypeMethodDescriptionstatic <C,K extends ArgumentParser<C, ?>, S>
@NonNull BrigadierMappingBuilder<K,S> builder()Returns a new mapping builder.static <T> com.mojang.brigadier.suggestion.SuggestionProvider<T>Returns a sentinel value for declaring that suggestions should be delegated to cloud.makeSuggestionProvider(K commandArgument) Creates a Brigadier suggestion provider for the givencommandArgument.mapper()Returns the mapping function.withNativeSuggestions(boolean nativeSuggestions) Returns a new version of this mapping that uses native suggestions ifnativeSuggestionsistrue, or cloud suggestions if it'sfalse.
-
Method Details
-
delegateSuggestions
public static <T> com.mojang.brigadier.suggestion.SuggestionProvider<T> delegateSuggestions()Returns a sentinel value for declaring that suggestions should be delegated to cloud.- Type Parameters:
T- the sender type- Returns:
- a singleton sentinel suggestion provider
-
builder
public static <C,K extends ArgumentParser<C, @NonNull BrigadierMappingBuilder<K,?>, S> S> builder()Returns a new mapping builder.- Type Parameters:
C- the command sender typeK- the argument parser typeS- the brigadier sender type- Returns:
- the mapping builder
-
mapper
Returns the mapping function.- Returns:
- the mapper
-
withNativeSuggestions
Returns a new version of this mapping that uses native suggestions ifnativeSuggestionsistrue, or cloud suggestions if it'sfalse.- Parameters:
nativeSuggestions- whether to use native suggestions- Returns:
- the new mapping
-
makeSuggestionProvider
public @Nullable com.mojang.brigadier.suggestion.SuggestionProvider<S> makeSuggestionProvider(K commandArgument) Creates a Brigadier suggestion provider for the givencommandArgument.- Parameters:
commandArgument- the argument- Returns:
- the suggestion provider
-