Class BrigadierSuggestionFactory<C,S>

java.lang.Object
org.incendo.cloud.brigadier.suggestion.BrigadierSuggestionFactory<C,S>
Type Parameters:
C - command sender type
S - 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

    Constructors
    Constructor
    Description
    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.
  • Method Summary

    Modifier and Type
    Method
    Description
    @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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 manager
      commandManager - the command manager
      dummyContextProvider - creates the context provided when retrieving suggestions
      suggestionFactory - 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 context
      parentNode - the parent command node
      component - the command component to generate suggestions for
      builder - the suggestion builder to generate suggestions with
      Returns:
      future that completes with the suggestions