Class CommandAPIConfig<Impl extends CommandAPIConfig<Impl>>

java.lang.Object
dev.jorel.commandapi.CommandAPIConfig<Impl>
All Implemented Interfaces:
ChainableBuilder<Impl>

public abstract class CommandAPIConfig<Impl extends CommandAPIConfig<Impl>> extends Object implements ChainableBuilder<Impl>
A class to contain information about how to configure the CommandAPI during its loading step. You shouldn't use this class directly. Instead, use an appropriate subclass that corresponds to the platform you are developing for.
  • Constructor Details

    • CommandAPIConfig

      public CommandAPIConfig()
  • Method Details

    • verboseOutput

      public Impl verboseOutput(boolean value)
      Sets verbose output logging for the CommandAPI if true.
      Parameters:
      value - whether verbose output should be enabled
      Returns:
      this CommandAPIConfig
    • silentLogs

      public Impl silentLogs(boolean value)
      Silences all logs (including warnings, but not errors) for the CommandAPI if true.
      Parameters:
      value - whether logging suppression should be enabled
      Returns:
      this CommandAPIConfig
    • missingExecutorImplementationMessage

      public Impl missingExecutorImplementationMessage(String value)
      Sets the message to display to users when a command has no executor. Available formatting parameters are:
      • %s - the executor class (lowercase)
      • %S - the executor class (normal case)
      Parameters:
      value - the message to display when a command has no executor
      Returns:
      this CommandAPIConfig
    • dispatcherFile

      public Impl dispatcherFile(File file)
      Specifies the location for the CommandAPI to store the internal representation of Brigadier's command tree.
      Parameters:
      file - a file pointing to where to store Brigadier's JSON command dispatcher, for example new File(getDataFolder(), "command_registration.json"). If this argument is null, this file will not be created.
      Returns:
      this CommandAPIConfig
    • setNamespace

      public Impl setNamespace(String namespace)
      Sets the default namespace to use when register commands
      Parameters:
      namespace - the namespace to use when register commands
      Returns:
      this CommandAPIConfig
    • enableNetworking

      public Impl enableNetworking(boolean enabled)
      Sets whether the CommandAPI's networking functionality should be enabled. This is currently only useful for allowing command requirements on Velocity.
      Parameters:
      enabled - whether networking should be enabled
      Returns:
      this CommandAPIConfig
    • makeNetworkingExceptionsWarnings

      public Impl makeNetworkingExceptionsWarnings(boolean value)
      Sets whether the CommandAPI should throw an exception if it cannot send or receive a packet. If true, the problem will be logged as a warning instead.
      Parameters:
      value - Whether networking exceptions should be logged as warnings.
      Returns:
      this CommandAPIConfig