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

    Fields inherited from class dev.esophose.playerparticles.manager.Manager

    playerParticles
  • Constructor Summary

    Constructors 
    Constructor Description
    CommandManager​(PlayerParticles playerParticles)  
  • Method Summary

    Modifier and Type Method Description
    void disable()
    Cleans up the Manager's resources
    CommandModule findMatchingCommand​(java.lang.String commandName)
    Finds a matching CommandModule by its name
    java.util.List<java.lang.String> getCommandNames()
    Get all available command names
    java.util.List<CommandModule> getCommands()
    Get a list of all available commands
    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
    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
    void reload()
    Reloads the Manager's settings

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • reload

      public void reload()
      Description copied from class: Manager
      Reloads the Manager's settings
      Specified by:
      reload in class Manager
    • disable

      public void disable()
      Description copied from class: Manager
      Cleans up the Manager's resources
      Specified by:
      disable in class Manager
    • findMatchingCommand

      public CommandModule findMatchingCommand​(java.lang.String commandName)
      Finds a matching CommandModule by its name
      Parameters:
      commandName - The command name
      Returns:
      The found CommandModule, otherwise null
    • getCommands

      public java.util.List<CommandModule> 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 interface org.bukkit.command.CommandExecutor
      Parameters:
      sender - Who executed the command
      cmd - The command
      label - The command label
      args - 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 interface org.bukkit.command.TabCompleter
      Parameters:
      sender - The sender that hit tab, should always be a player
      cmd - The command the player is executing
      alias - The possible alias for the command
      args - All arguments following the command
      Returns:
      A list of commands available to the sender