Interface IPlayerConfigOptionSpecAPI<T extends Comparable<T>>

Type Parameters:
T - the type of values of this option

public interface IPlayerConfigOptionSpecAPI<T extends Comparable<T>>
A player config option instance used for player config option representation in various API features.
  • Method Details

    • getId

      @Nonnull String getId()
      Gets the ID of this option.

      Use getPath() if you need it separated into elements.

      Returns:
      the string ID, not null
    • getShortenedId

      @Nonnull String getShortenedId()
      Gets the shortened ID of this option, without the "playerConfig." prefix.
      Returns:
      the shortened string ID, not null
    • getPath

      @Nonnull List<String> getPath()
      Gets the path of this option, which is just the ID from getId() but separated into elements.
      Returns:
      the path, not null
    • getType

      @Nonnull Class<T> getType()
      Gets the type of values that this option can have.
      Returns:
      the type of values, not null
    • getTranslation

      @Nonnull String getTranslation()
      Gets the translation key for the name of this option.
      Returns:
      the translation key, not null
    • getTranslationArgs

      @Nonnull String[] getTranslationArgs()
      Gets the translation key arguments for the name of this option.
      Returns:
      the translation key arguments, not null
    • getCommentTranslation

      @Nonnull String getCommentTranslation()
      Gets the translation key for the comment of this option.
      Returns:
      the comment translation key, not null
    • getCommentTranslationArgs

      @Nonnull String[] getCommentTranslationArgs()
      Gets the translation key arguments for the comment of this option.
      Returns:
      the comment translation key arguments, not null
    • getComment

      @Nonnull String getComment()
      Gets the default en_us comment for this option.
      Returns:
      the default comment, not null
    • getDefaultValue

      @Nonnull T getDefaultValue()
      Gets the default value that this option is set to in configs.
      Returns:
      the default value, not null
    • getClientSideValidator

      @Nonnull BiPredicate<IPlayerConfigClientStorageAPI,T> getClientSideValidator()
      Gets the client-side validator for potential values of this option.
      Returns:
      the client-side value validator, not null
    • getServerSideValidator

      @Nonnull BiPredicate<IPlayerConfigAPI,T> getServerSideValidator()
      Gets the server-side validator for potential values of this option.
      Returns:
      the server-side value validator, not null
    • getTooltipPrefix

      @Nullable String getTooltipPrefix()
      Gets the prefix applied to the tooltip of this option on the UI.
      Returns:
      the tooltip prefix, null if no prefix
    • getCommandInputParser

      @Nonnull Function<String,T> getCommandInputParser()
      Gets the String->value parser of this option, mainly used for commands.
      Returns:
      the String->value parser, not null
    • getCommandOutputWriter

      @Nonnull Function<T,net.minecraft.network.chat.Component> getCommandOutputWriter()
      Gets the value->String converter of this option, mainly used for commands.
      Returns:
      the value->String converter, not null
    • getConfigTypeFilter

      @Nonnull Predicate<PlayerConfigType> getConfigTypeFilter()
      Gets the config type filter of this option.

      The filter allows this option to only appear and be configurable on some types of player configs (e.g. just the server claims config).

      Returns:
      the config type filter, not null