mondocommand
Class MondoCommand

java.lang.Object
  extended by mondocommand.MondoCommand
All Implemented Interfaces:
SubHandler, org.bukkit.command.CommandExecutor

public class MondoCommand
extends Object
implements org.bukkit.command.CommandExecutor, SubHandler

Handle commands dynamically with sub-command registration.

Author:
James Crasta

Constructor Summary
MondoCommand()
          Create a new MondoCommand with the base formatting specification.
MondoCommand(FormatConfig formatter)
          Create a new MondoCommand, used for dynamic sub command handling.
 
Method Summary
 SubCommand addSub(String name)
          Add a sub-command to this MondoCommand.
 SubCommand addSub(String name, String permission)
          Add a sub-command to this MondoCommand.
 void autoRegisterFrom(Object handler)
           
 void handle(CallInfo call)
          Implement the SubHandler interface so we can do sub-sub commands and such.
 List<SubCommand> listCommands()
           
 boolean onCommand(org.bukkit.command.CommandSender sender, org.bukkit.command.Command cmd, String commandLabel, String[] args)
          Implement onCommand so this can be registered as a CommandExecutor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MondoCommand

public MondoCommand()
Create a new MondoCommand with the base formatting specification.


MondoCommand

public MondoCommand(FormatConfig formatter)
Create a new MondoCommand, used for dynamic sub command handling.

Parameters:
formatter - Configuration on how to format responses.
Method Detail

onCommand

public boolean onCommand(org.bukkit.command.CommandSender sender,
                         org.bukkit.command.Command cmd,
                         String commandLabel,
                         String[] args)
Implement onCommand so this can be registered as a CommandExecutor

Specified by:
onCommand in interface org.bukkit.command.CommandExecutor

handle

public void handle(CallInfo call)
            throws MondoFailure
Implement the SubHandler interface so we can do sub-sub commands and such.

Specified by:
handle in interface SubHandler
Parameters:
call - Contains all the information about the call.
Throws:
MondoFailure - An optional error trap mechanism to display errors.

addSub

public SubCommand addSub(String name,
                         String permission)
Add a sub-command to this MondoCommand.

Parameters:
name - The name of this sub-command.
permission - The permission string of a permission to check for this command.
Returns:
a new SubCommand.

addSub

public SubCommand addSub(String name)
Add a sub-command to this MondoCommand.

Parameters:
name - the name of this sub-command.
Returns:
a new SubCommand.

autoRegisterFrom

public void autoRegisterFrom(Object handler)

listCommands

public List<SubCommand> listCommands()


Copyright © 2013. All Rights Reserved.