Class BrigadierMapping<C,K extends org.incendo.cloud.parser.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 org.incendo.cloud.parser.ArgumentParser<C,?>,S> extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static <C, K extends org.incendo.cloud.parser.ArgumentParser<C, ?>, S>
    @NonNull BrigadierMappingBuilder<K,S>
    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.
    @Nullable com.mojang.brigadier.suggestion.SuggestionProvider<S>
    makeSuggestionProvider(K commandArgument)
    Creates a Brigadier suggestion provider for the given commandArgument.
    @Nullable Function<K,? extends com.mojang.brigadier.arguments.ArgumentType<?>>
    Returns the mapping function.
    @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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 org.incendo.cloud.parser.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