Class BukkitScriptCommand
java.lang.Object
dev.magicmq.pyspigot.bukkit.manager.command.BukkitScriptCommand
- All Implemented Interfaces:
dev.magicmq.pyspigot.manager.command.ScriptCommand,CommandExecutor,TabCompleter,TabExecutor
public class BukkitScriptCommand
extends Object
implements TabExecutor, dev.magicmq.pyspigot.manager.command.ScriptCommand
Represents a registered Bukkit command belonging to a script.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBukkitScriptCommand(dev.magicmq.pyspigot.manager.script.Script script, PyFunction commandFunction, PyFunction tabFunction, String name, String description, String usage, List<String> aliases, String permission) -
Method Summary
Modifier and TypeMethodDescriptionGet thePluginCommandthat underlies this ScriptCommandgetName()Get the name of this command.dev.magicmq.pyspigot.manager.script.ScriptGet the script associated with this command.protected voidinitHelp()booleanonCommand(CommandSender sender, Command cmd, String label, String[] args) onTabComplete(CommandSender sender, Command cmd, String alias, String[] args) protected voidtoString()Prints a representation of this ScriptCommand in string format, including all variables that pertain to the command (such as name, label, description, etc.)
-
Constructor Details
-
BukkitScriptCommand
public BukkitScriptCommand(dev.magicmq.pyspigot.manager.script.Script script, PyFunction commandFunction, PyFunction tabFunction, String name, String description, String usage, List<String> aliases, String permission) - Parameters:
script- The script to which this command belongscommandFunction- The command function that should be called when the command is executedtabFunction- The tab function that should be called for tab completion of the command. Can be nullname- The name of the command to registerdescription- The description of the command. Use an empty string for no descriptionusage- The usage message for the commandaliases- A List of String containing all the aliases for this command. Use an empty list for no aliasespermission- The required permission node to use this command. Can be null
-
-
Method Details
-
onCommand
- Specified by:
onCommandin interfaceCommandExecutor
-
onTabComplete
- Specified by:
onTabCompletein interfaceTabCompleter
-
getScript
public dev.magicmq.pyspigot.manager.script.Script getScript()Get the script associated with this command.- Specified by:
getScriptin interfacedev.magicmq.pyspigot.manager.command.ScriptCommand- Returns:
- The script associated with this command
-
getName
Get the name of this command.- Specified by:
getNamein interfacedev.magicmq.pyspigot.manager.command.ScriptCommand- Returns:
- The name of this command
-
getBukkitCommand
Get thePluginCommandthat underlies this ScriptCommand- Returns:
- The underlying PluginCommand
-
initHelp
protected void initHelp() -
removeHelp
protected void removeHelp() -
toString
Prints a representation of this ScriptCommand in string format, including all variables that pertain to the command (such as name, label, description, etc.)
-