Interface ArgumentSuggestions<CommandSender>

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ArgumentSuggestions<CommandSender>
This class represents suggestions for an argument. ArgumentSuggestions objects are best created using the static methods as opposed to functionally.
  • Method Details

    • suggest

      CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggest(SuggestionInfo<CommandSender> info, com.mojang.brigadier.suggestion.SuggestionsBuilder builder) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Create a CompletableFuture resolving onto a brigadier Suggestions object.
      Parameters:
      info - The suggestions info
      builder - The Brigadier SuggestionsBuilder object
      Returns:
      a CompletableFuture resolving onto a brigadier Suggestions object.
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException - if there is an error making suggestions
    • empty

      static <CommandSender> ArgumentSuggestions<CommandSender> empty()
      Suggest nothing
      Returns:
      an ArgumentSuggestions object suggesting nothing.
    • strings

      static <CommandSender> ArgumentSuggestions<CommandSender> strings(String... suggestions)
      Suggest hardcoded strings
      Parameters:
      suggestions - array of hardcoded strings
      Returns:
      an ArgumentSuggestions object suggesting hardcoded strings
    • strings

      static <CommandSender> ArgumentSuggestions<CommandSender> strings(Collection<String> suggestions)
      Suggest hardcoded strings
      Parameters:
      suggestions - collection of hardcoded strings
      Returns:
      an ArgumentSuggestions object suggesting hardcoded strings
    • strings

      static <CommandSender> ArgumentSuggestions<CommandSender> strings(Function<SuggestionInfo<CommandSender>,String[]> suggestions)
      Suggest an array of strings as the result of a function
      Parameters:
      suggestions - function providing the strings as an array
      Returns:
      an ArgumentSuggestions object suggesting the result of the function
    • stringCollection

      static <CommandSender> ArgumentSuggestions<CommandSender> stringCollection(Function<SuggestionInfo<CommandSender>,Collection<String>> suggestions)
      Suggest a collection of strings as the result of a function
      Parameters:
      suggestions - function providing the strings as a collection
      Returns:
      an ArgumentSuggestions object suggesting the result of the function
    • stringsAsync

      static <CommandSender> ArgumentSuggestions<CommandSender> stringsAsync(Function<SuggestionInfo<CommandSender>,CompletableFuture<String[]>> suggestions)
      Suggest an array of strings asynchronously
      Parameters:
      suggestions - function providing the array of strings asynchronously
      Returns:
      an ArgumentSuggestions object suggesting the result of the asynchronous function
    • stringCollectionAsync

      static <CommandSender> ArgumentSuggestions<CommandSender> stringCollectionAsync(Function<SuggestionInfo<CommandSender>,CompletableFuture<Collection<String>>> suggestions)
      Suggest a collection of strings asynchronously
      Parameters:
      suggestions - function providing the collection of strings asynchronously
      Returns:
      an ArgumentSuggestions object suggesting the result of the asynchronous function
    • stringsWithTooltips

      static <CommandSender> ArgumentSuggestions<CommandSender> stringsWithTooltips(IStringTooltip... suggestions)
      Suggest hardcoded strings with tooltips
      Parameters:
      suggestions - collection of hardcoded strings with tooltips
      Returns:
      an ArgumentSuggestions object suggesting the hardcoded strings with tooltips
    • stringsWithTooltips

      static <CommandSender> ArgumentSuggestions<CommandSender> stringsWithTooltips(Collection<IStringTooltip> suggestions)
      Suggest hardcoded strings with tooltips
      Parameters:
      suggestions - collection of hardcoded strings with tooltips
      Returns:
      an ArgumentSuggestions object suggesting the hardcoded strings with tooltips
    • stringsWithTooltips

      static <CommandSender> ArgumentSuggestions<CommandSender> stringsWithTooltips(Function<SuggestionInfo<CommandSender>,IStringTooltip[]> suggestions)
      Suggest an array of strings with tooltips as the result of a function
      Parameters:
      suggestions - function providing the array of strings with tooltips
      Returns:
      an ArgumentSuggestions object suggesting the result of the function
    • stringsWithTooltipsCollection

      static <CommandSender> ArgumentSuggestions<CommandSender> stringsWithTooltipsCollection(Function<SuggestionInfo<CommandSender>,Collection<IStringTooltip>> suggestions)
      Suggest a collection of strings with tooltips as the result of a function
      Parameters:
      suggestions - function providing the collection of strings with tooltips
      Returns:
      an ArgumentSuggestions object suggesting the result of the function
    • stringsWithTooltipsAsync

      static <CommandSender> ArgumentSuggestions<CommandSender> stringsWithTooltipsAsync(Function<SuggestionInfo<CommandSender>,CompletableFuture<IStringTooltip[]>> suggestions)
      Suggest an array of strings with tooltips asynchronously
      Parameters:
      suggestions - function providing the array of strings with tooltips asynchronously
      Returns:
      an ArgumentSuggestions object suggesting the result of the asynchronous function
    • stringsWithTooltipsCollectionAsync

      static <CommandSender> ArgumentSuggestions<CommandSender> stringsWithTooltipsCollectionAsync(Function<SuggestionInfo<CommandSender>,CompletableFuture<Collection<IStringTooltip>>> suggestions)
      Suggest a collection of strings with tooltips asynchronously
      Parameters:
      suggestions - function providing the collection of strings with tooltips asynchronously
      Returns:
      an ArgumentSuggestions object suggesting the result of the asynchronous function
    • merge

      @SafeVarargs static <CommandSender> ArgumentSuggestions<CommandSender> merge(ArgumentSuggestions<CommandSender>... suggestions)
      Merge suggestions from multiple ArgumentSuggestions together
      Parameters:
      suggestions - The ArgumentSuggestions to be merged
      Returns:
      an ArgumentSuggestions object suggesting everything suggested by the input suggestions