Class BrigadierMapping<C,K extends ArgumentParser<C,?>,S>

java.lang.Object
org.incendo.cloud.brigadier.argument.BrigadierMapping<C,K,S>

@API(status=INTERNAL, since="2.0.0") public final class BrigadierMapping<C,K extends ArgumentParser<C,?>,S> extends Object
  • 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, ?>, S> @NonNull BrigadierMappingBuilder<K,S> builder()
      Returns a new mapping builder.
      Type Parameters:
      C - the command sender type
      K - the argument parser type
      S - the brigadier sender type
      Returns:
      the mapping builder
    • mapper

      public @Nullable Function<K,? extends com.mojang.brigadier.arguments.ArgumentType<?>> mapper()
      Returns the mapping function.
      Returns:
      the mapper
    • withNativeSuggestions

      public @NonNull BrigadierMapping<C,K,S> withNativeSuggestions(boolean nativeSuggestions)
      Returns a new version of this mapping that uses native suggestions if nativeSuggestions is true, or cloud suggestions if it's false.
      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 given commandArgument.
      Parameters:
      commandArgument - the argument
      Returns:
      the suggestion provider