public class CommandStore
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
CommandStore.StoredCommand
Contains detailed information on a loaded command.
|
Modifier and Type | Method and Description |
---|---|
static java.util.List<java.lang.String> |
getCommandsWithTag(java.lang.String tag)
Returns all commands with a specific tag.
|
static java.util.List<java.lang.String> |
getKnownTags()
Returns all command tags that the mod is currently aware of.
|
static java.util.List<java.lang.String> |
getLoadedCommands()
Returns all commands currently loaded by the mod.
|
static void |
reloadCommands()
Forces the console to clear its stored commands and reload them from the
CSV.
|
static CommandStore.StoredCommand |
retrieveCommand(java.lang.String command)
Retrieves the raw data for a specific command.
|
public static void reloadCommands() throws java.io.IOException, org.json.JSONException
Exception
. Instead it will display an error message to the
player and continue to load the rest of the commands normally.java.io.IOException
- if the CSV file at CommonStrings.CSV_PATH
does not exist or can't be opened.org.json.JSONException
- if the CSV is malformed or missing columns.public static java.util.List<java.lang.String> getLoadedCommands()
List
containing the names of all loaded commands.
public static java.util.List<java.lang.String> getKnownTags()
List
containing all tags used by the currently loaded
commands.
public static java.util.List<java.lang.String> getCommandsWithTag(java.lang.String tag)
tag
- The tag to search for.
List
containing the names of all loaded commands that
use the tag tag
.
public static CommandStore.StoredCommand retrieveCommand(java.lang.String command)
command
- The name of the command to retrieve.
CommandStore.StoredCommand
containing all of the data the console
needs to use this command, such as its name, class, syntax, helpfile, and
what mod registered it.