Interface ConfigCommandApi

All Known Implementing Classes:
ConfigCommandImpl

public interface ConfigCommandApi
Provides methods for creating and registering config commands using ConfigHolders.

A generated config command will have the following subcommands:

     reset:
         Resets the config to default values
     reload:
         Reloads the config from disk
     get:
         option:
             Gets the given config options value.
     set:
         option:
             If there's no way to represent the config option in a command,
             this will tell the user to modify it manually.
             newValue:
                 Sets the given config option to the given new value.
 
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final ConfigCommandApi
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.mojang.brigadier.builder.LiteralArgumentBuilder<?>
    createConfigCommand(String commandName, top.offsetmonkey538.offsetconfig538.api.config.ConfigHolder<?> configHolder)
    Creates a config command using the provided name and ConfigHolder.
    static com.mojang.brigadier.builder.LiteralArgumentBuilder<?>
    createConfigCommand(String commandName, top.offsetmonkey538.offsetconfig538.api.config.ConfigHolder<?> configHolder, @Nullable Runnable configReloadCallback)
    Creates a config command using the provided name and ConfigHolder.
    static com.mojang.brigadier.builder.LiteralArgumentBuilder<?>
    createConfigCommand(String commandName, top.offsetmonkey538.offsetconfig538.api.config.ConfigHolder<?> configHolder, @Nullable Runnable configReloadCallback, @Nullable Runnable configValueSetCallback)
    Creates a config command using the provided name and ConfigHolder.
    com.mojang.brigadier.builder.LiteralArgumentBuilder<?>
    createConfigCommandImpl(String commandName, top.offsetmonkey538.offsetconfig538.api.config.ConfigHolder<?> configHolder, @Nullable Runnable configReloadCallback, @Nullable Runnable configValueSetCallback)
     
    static void
    registerConfigCommand(top.offsetmonkey538.offsetconfig538.api.config.ConfigHolder<?> configHolder, @Nullable Runnable configReloadCallback, @Nullable Runnable configValueSetCallback, String... commandTree)
    Creates and registers a config command using the provided command tree and ConfigHolder.
    static void
    registerConfigCommand(top.offsetmonkey538.offsetconfig538.api.config.ConfigHolder<?> configHolder, @Nullable Runnable configReloadCallback, String... commandTree)
    Creates and registers a config command using the provided command tree and ConfigHolder.
    static void
    registerConfigCommand(top.offsetmonkey538.offsetconfig538.api.config.ConfigHolder<?> configHolder, String... commandTree)
    Creates and registers a config command using the provided command tree and ConfigHolder.
    void
    registerConfigCommandImpl(top.offsetmonkey538.offsetconfig538.api.config.ConfigHolder<?> configHolder, @Nullable Runnable configReloadCallback, @Nullable Runnable configValueSetCallback, String... commandTree)
     
  • Field Details

  • Method Details

    • registerConfigCommand

      static void registerConfigCommand(top.offsetmonkey538.offsetconfig538.api.config.ConfigHolder<?> configHolder, String... commandTree)
      Creates and registers a config command using the provided command tree and ConfigHolder.

      The command tree could for example be "modid", "config" for the command to look like /modid config reset/reload/get/set

      Parameters:
      configHolder - your ConfigHolder instance.
      commandTree - the command tree.
    • registerConfigCommand

      static void registerConfigCommand(top.offsetmonkey538.offsetconfig538.api.config.ConfigHolder<?> configHolder, @Nullable Runnable configReloadCallback, String... commandTree)
      Creates and registers a config command using the provided command tree and ConfigHolder.
      The configReloadCallback is executed after the reload command is run, and can be used for reinitializing stuff based on the new values.

      The command tree could for example be "modid", "config" for the command to look like /modid config reset/reload/get/set

      Parameters:
      configHolder - your ConfigHolder instance.
      configReloadCallback - executed when config is reloaded by the reload command.
      commandTree - the command tree.
    • registerConfigCommand

      static void registerConfigCommand(top.offsetmonkey538.offsetconfig538.api.config.ConfigHolder<?> configHolder, @Nullable Runnable configReloadCallback, @Nullable Runnable configValueSetCallback, String... commandTree)
      Creates and registers a config command using the provided command tree and ConfigHolder.
      The configReloadCallback is executed after the reload command is run, and can be used for reinitializing stuff based on the new values.

      The command tree could for example be "modid", "config" for the command to look like /modid config reset/reload/get/set

      Parameters:
      configHolder - your ConfigHolder instance.
      configReloadCallback - executed when config is reloaded by the reload command.
      configValueSetCallback - executed when a config value is changed by the set command.
      commandTree - the command tree.
    • createConfigCommand

      static com.mojang.brigadier.builder.LiteralArgumentBuilder<?> createConfigCommand(String commandName, top.offsetmonkey538.offsetconfig538.api.config.ConfigHolder<?> configHolder)
      Creates a config command using the provided name and ConfigHolder.
      Parameters:
      commandName - the name of the command.
      configHolder - your ConfigHolder instance.
      Returns:
      a config command using the provided name and ConfigHolder.
    • createConfigCommand

      static com.mojang.brigadier.builder.LiteralArgumentBuilder<?> createConfigCommand(String commandName, top.offsetmonkey538.offsetconfig538.api.config.ConfigHolder<?> configHolder, @Nullable Runnable configReloadCallback)
      Creates a config command using the provided name and ConfigHolder.
      The configReloadCallback is executed after the reload command is run, and can be used for reinitializing stuff based on the new values.
      Parameters:
      commandName - the name of the command.
      configReloadCallback - executed when config is reloaded by the reload command.
      configHolder - your ConfigHolder instance.
      Returns:
      a config command using the provided name and ConfigHolder.
    • createConfigCommand

      static com.mojang.brigadier.builder.LiteralArgumentBuilder<?> createConfigCommand(String commandName, top.offsetmonkey538.offsetconfig538.api.config.ConfigHolder<?> configHolder, @Nullable Runnable configReloadCallback, @Nullable Runnable configValueSetCallback)
      Creates a config command using the provided name and ConfigHolder.
      The configReloadCallback is executed after the reload command is run, and can be used for reinitializing stuff based on the new values.
      Parameters:
      commandName - the name of the command.
      configReloadCallback - executed when config is reloaded by the reload command.
      configValueSetCallback - executed when a config value is changed by the set command.
      configHolder - your ConfigHolder instance.
      Returns:
      a config command using the provided name and ConfigHolder.
    • registerConfigCommandImpl

      @Internal void registerConfigCommandImpl(top.offsetmonkey538.offsetconfig538.api.config.ConfigHolder<?> configHolder, @Nullable Runnable configReloadCallback, @Nullable Runnable configValueSetCallback, String... commandTree)
    • createConfigCommandImpl

      @Internal com.mojang.brigadier.builder.LiteralArgumentBuilder<?> createConfigCommandImpl(String commandName, top.offsetmonkey538.offsetconfig538.api.config.ConfigHolder<?> configHolder, @Nullable Runnable configReloadCallback, @Nullable Runnable configValueSetCallback)