Interface CommandFacade
public interface CommandFacade
A
CommandFacade is a simple abstraction for advanced command systems in Mindustry.
It is typically implemented by a CommandHandler.Command.-
Method Summary
Modifier and TypeMethodDescriptionstatic CommandFacadefrom(arc.util.CommandHandler.Command command) Extracts aCommandFacadefrom a native command.Returns the description of the root command node or the command itself.getHelp(CommandSender sender, String query) Returns the help information for this command.getName()Returns the name of this command.@Nullable MindustryPluginReturns the plugin that owns this command.Returns the real name of this command.booleanisAlias()Returns whether this command is an alias of another command.booleanisVisible(CommandSender sender) Returns whether this command is visible at all to the given sender.
-
Method Details
-
from
Extracts aCommandFacadefrom a native command.- Parameters:
command- the command to extract from- Returns:
- the facade of the native command
-
getRealName
String getRealName()Returns the real name of this command. -
getName
String getName()Returns the name of this command. Usually returnsgetRealName(), but if another command with the same name was registered before, the owning plugin identifier will be prefixed to the name. Such asplugin:name. -
getDescription
DescriptionFacade getDescription()Returns the description of the root command node or the command itself. -
isAlias
boolean isAlias()Returns whether this command is an alias of another command. -
isVisible
Returns whether this command is visible at all to the given sender.- Parameters:
sender- the sender to check visibility for- Returns:
- whether this command is visible to the given sender
-
getHelp
Returns the help information for this command. The result is affected by the permissions of the sender.- Parameters:
sender- the sender to get the help forquery- the query to get the help for- Returns:
- the help information for this command
-
getPlugin
@Nullable MindustryPlugin getPlugin()Returns the plugin that owns this command.
-