Class BrigadierSuggestionFactory<C,S>
java.lang.Object
org.incendo.cloud.brigadier.suggestion.BrigadierSuggestionFactory<C,S>
- Type Parameters:
C- command sender typeS- Brigadier sender type
@API(status=INTERNAL,
since="2.0.0")
public final class BrigadierSuggestionFactory<C,S>
extends Object
Produces Brigadier suggestions by invoking the Cloud suggestion provider.
- Since:
- 2.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionBrigadierSuggestionFactory(@NonNull CloudBrigadierManager<C, S> cloudBrigadierManager, @NonNull org.incendo.cloud.CommandManager<C> commandManager, @NonNull Supplier<org.incendo.cloud.context.CommandContext<C>> dummyContextProvider, @NonNull org.incendo.cloud.suggestion.SuggestionFactory<C, ? extends TooltipSuggestion> suggestionFactory) Creates a new suggestion factory. -
Method Summary
Modifier and TypeMethodDescription@NonNull CompletableFuture<@NonNull com.mojang.brigadier.suggestion.Suggestions>buildSuggestions(@Nullable com.mojang.brigadier.context.CommandContext<S> senderContext, @Nullable org.incendo.cloud.internal.CommandNode<C> parentNode, @NonNull org.incendo.cloud.component.CommandComponent<C> component, @NonNull com.mojang.brigadier.suggestion.SuggestionsBuilder builder) Builds suggestions for the given component.
-
Constructor Details
-
BrigadierSuggestionFactory
public BrigadierSuggestionFactory(@NonNull CloudBrigadierManager<C, S> cloudBrigadierManager, @NonNull org.incendo.cloud.CommandManager<C> commandManager, @NonNull Supplier<org.incendo.cloud.context.CommandContext<C>> dummyContextProvider, @NonNull org.incendo.cloud.suggestion.SuggestionFactory<C, ? extends TooltipSuggestion> suggestionFactory) Creates a new suggestion factory.- Parameters:
cloudBrigadierManager- the brigadier managercommandManager- the command managerdummyContextProvider- creates the context provided when retrieving suggestionssuggestionFactory- the suggestion factory-producing tooltip suggestions
-
-
Method Details
-
buildSuggestions
public @NonNull CompletableFuture<@NonNull com.mojang.brigadier.suggestion.Suggestions> buildSuggestions(@Nullable com.mojang.brigadier.context.CommandContext<S> senderContext, @Nullable org.incendo.cloud.internal.CommandNode<C> parentNode, @NonNull org.incendo.cloud.component.CommandComponent<C> component, @NonNull com.mojang.brigadier.suggestion.SuggestionsBuilder builder) Builds suggestions for the given component.- Parameters:
senderContext- the brigadier contextparentNode- the parent command nodecomponent- the command component to generate suggestions forbuilder- the suggestion builder to generate suggestions with- Returns:
- future that completes with the suggestions
-