-
public class CommandStoreThe console mod's internal command storage. You can retrieve detailed information on the loaded commands using this class.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classCommandStore.StoredCommandContains detailed information on a loaded command.
-
Method Summary
Modifier and Type Method Description static voidreloadAll()Forces the console to clear its stored commands and reload them from theCSV. static voidreloadCommands()static voidreloadAliases()static voidreloadListeners()static List<String>getLoadedCommands()Returns all commands currently loaded by the mod. static List<String>getApplicableCommands(BaseCommand.CommandContext context)Returns all commands applicable in the given CommandContext. static voidregisterAlias(String alias, String command)Registers an alias to be used as shorthand for long or multiple commands.. static List<String>getKnownTags()Returns all command tags that the mod is currently aware of. static List<String>getCommandsWithTag(String tag)Returns all commands with a specific tag. static CommandStore.StoredCommandretrieveCommand(String command)Retrieves the internal data for a specific command. static Map<String, String>getAliases()Returns all aliases currently registered by the mod. -
-
Method Detail
-
reloadAll
static void reloadAll()
Forces the console to clear its stored commands and reload them from theCSV. If a command fails to load it will not throw an Exception. Instead it will display an error message to theplayer and continue to load the rest of the commands normally.
-
reloadCommands
static void reloadCommands()
-
reloadAliases
static void reloadAliases()
-
reloadListeners
static void reloadListeners()
-
getLoadedCommands
static List<String> getLoadedCommands()
Returns all commands currently loaded by the mod.
-
getApplicableCommands
static List<String> getApplicableCommands(BaseCommand.CommandContext context)
Returns all commands applicable in the given CommandContext. A command will only be excluded if itcontains an opposing tag and does not contain the matching one (ex: for CAMPAIGN_MAP,commands will only be excluded if they contain the tag "combat" or "market" but not the tag "campaign".
Commands with the tag "console" are assumed to be system-level, and will run anywhere.
-
registerAlias
static void registerAlias(String alias, String command)
Registers an alias to be used as shorthand for long or multiple commands..
- Parameters:
alias- The alias to register.command- The command that will be run in place of{@code alias}.
-
getKnownTags
static List<String> getKnownTags()
Returns all command tags that the mod is currently aware of.
-
getCommandsWithTag
static List<String> getCommandsWithTag(String tag)
Returns all commands with a specific tag.
- Parameters:
tag- The tag to search for.
-
retrieveCommand
static CommandStore.StoredCommand retrieveCommand(String command)
Retrieves the internal data for a specific command.
- Parameters:
command- The name of the command to retrieve.
-
getAliases
static Map<String, String> getAliases()
Returns all aliases currently registered by the mod.
-
-
-
-