Class CommandManager
java.lang.Object
dev.esophose.playerparticles.manager.Manager
dev.esophose.playerparticles.manager.CommandManager
- All Implemented Interfaces:
org.bukkit.command.CommandExecutor
,org.bukkit.command.TabCompleter
public class CommandManager extends Manager implements org.bukkit.command.CommandExecutor, org.bukkit.command.TabCompleter
-
Field Summary
-
Constructor Summary
Constructors Constructor Description CommandManager(PlayerParticles playerParticles)
-
Method Summary
Modifier and Type Method Description void
disable()
Cleans up the Manager's resourcesCommandModule
findMatchingCommand(java.lang.String commandName)
Finds a matching CommandModule by its namejava.util.List<java.lang.String>
getCommandNames()
Get all available command namesjava.util.List<CommandModule>
getCommands()
Get a list of all available commandsboolean
onCommand(org.bukkit.command.CommandSender sender, org.bukkit.command.Command cmd, java.lang.String label, java.lang.String[] args)
Called when a player executes a PlayerParticles command Checks what PlayerParticles command it is and calls the corresponding modulejava.util.List<java.lang.String>
onTabComplete(org.bukkit.command.CommandSender sender, org.bukkit.command.Command cmd, java.lang.String alias, java.lang.String[] args)
Activated when a user pushes tab in chat prefixed with /ppvoid
reload()
Reloads the Manager's settings
-
Constructor Details
-
Method Details
-
reload
public void reload()Description copied from class:Manager
Reloads the Manager's settings -
disable
public void disable()Description copied from class:Manager
Cleans up the Manager's resources -
findMatchingCommand
Finds a matching CommandModule by its name- Parameters:
commandName
- The command name- Returns:
- The found CommandModule, otherwise null
-
getCommands
Get a list of all available commands- Returns:
- A List of all CommandModules registered
-
getCommandNames
public java.util.List<java.lang.String> getCommandNames()Get all available command names- Returns:
- All available command names
-
onCommand
public boolean onCommand(org.bukkit.command.CommandSender sender, org.bukkit.command.Command cmd, java.lang.String label, java.lang.String[] args)Called when a player executes a PlayerParticles command Checks what PlayerParticles command it is and calls the corresponding module- Specified by:
onCommand
in interfaceorg.bukkit.command.CommandExecutor
- Parameters:
sender
- Who executed the commandcmd
- The commandlabel
- The command labelargs
- The arguments following the command- Returns:
- true
-
onTabComplete
public java.util.List<java.lang.String> onTabComplete(org.bukkit.command.CommandSender sender, org.bukkit.command.Command cmd, java.lang.String alias, java.lang.String[] args)Activated when a user pushes tab in chat prefixed with /pp- Specified by:
onTabComplete
in interfaceorg.bukkit.command.TabCompleter
- Parameters:
sender
- The sender that hit tab, should always be a playercmd
- The command the player is executingalias
- The possible alias for the commandargs
- All arguments following the command- Returns:
- A list of commands available to the sender
-