Package dev.jorel.commandapi
Class CommandAPIConfig
java.lang.Object
dev.jorel.commandapi.CommandAPIConfig
A class to contain information about how to configure the CommandAPI during
its loading step.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondispatcherFile(File file) Specifies the location for the CommandAPI to store the internal representation of Brigadier's command tree.<T> CommandAPIConfiginitializeNBTAPI(Class<T> nbtContainerClass, Function<Object, T> nbtContainerConstructor) Initializes the CommandAPI's implementation of an NBT API.Sets the message to display to users when a command has no executor.setCustomNMS(NMS<?> customNMS) Internal.silentLogs(boolean value) Silences all logs (including warnings, but not errors) for the CommandAPI if true.useLatestNMSVersion(boolean value) Sets whether the CommandAPI should run the latest available version of NMS support, regardless of Minecraft version.verboseOutput(boolean value) Sets verbose output logging for the CommandAPI if true.
-
Constructor Details
-
CommandAPIConfig
public CommandAPIConfig()
-
-
Method Details
-
verboseOutput
Sets verbose output logging for the CommandAPI if true.- Parameters:
value- whether verbose output should be enabled- Returns:
- this CommandAPIConfig
-
silentLogs
Silences all logs (including warnings, but not errors) for the CommandAPI if true.- Parameters:
value- whether logging suppression should be enabled- Returns:
- this CommandAPIConfig
-
useLatestNMSVersion
Sets whether the CommandAPI should run the latest available version of NMS support, regardless of Minecraft version. This may produce unexpected results if the latest NMS version is not supported by the CommandAPI. This can be used to potentially provide compatibility with future Minecraft versions before the CommandAPI pushes a release to support it.- Parameters:
value- whether the latest version of NMS should be used- Returns:
- this CommandAPIConfig
-
missingExecutorImplementationMessage
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
-
initializeNBTAPI
public <T> CommandAPIConfig initializeNBTAPI(Class<T> nbtContainerClass, Function<Object, T> nbtContainerConstructor) Initializes the CommandAPI's implementation of an NBT API.- Type Parameters:
T- the type that the NBT compound container class is- Parameters:
nbtContainerClass- the NBT compound container class. For example,NBTContainer.classnbtContainerConstructor- a function that takes an Object (NMSNBTTagCompound) and returns an instance of the provided NBT compound container. For example,NBTContainer::new.- Returns:
- this CommandAPIConfig
-
dispatcherFile
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 examplenew File(getDataFolder(), "command_registration.json"). If this argument isnull, this file will not be created.- Returns:
- this CommandAPIConfig
-
setCustomNMS
Internal. Do not use.- Parameters:
customNMS-- Returns:
-