-
- All Implemented Interfaces:
public class CommandStore
The 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 class
CommandStore.StoredCommand
Contains detailed information on a loaded command.
-
Method Summary
Modifier and Type Method Description static Map<String, String>
getAliases()
Returns all aliases currently registered by the mod. static void
reloadAll()
Forces the console to clear its stored commands and reload them from the CSV. static void
reloadCommands()
static void
reloadAliases()
static void
reloadListeners()
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 void
registerAlias(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.StoredCommand
retrieveCommand(String command)
Retrieves the internal data for a specific command. -
-
Method Detail
-
getAliases
static Map<String, String> getAliases()
Returns all aliases currently registered by the mod.
-
reloadAll
static void reloadAll()
Forces the console to clear its stored commands and reload them from the CSV. If a command fails to load it will not throw an Exception. Instead it will display an error message to the player 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 it contains 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 ofalias
.
-
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.
-
-
-
-