|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mondocommand.CallInfo
public class CallInfo
Represents all the arguments that go along with a call.
Constructor Summary | |
---|---|
CallInfo(org.bukkit.command.CommandSender sender,
org.bukkit.entity.Player player,
String baseCommand,
SubCommand subCommand,
List<String> args,
FormatConfig formatter)
Create a new CallInfo representing one command invocation. |
Method Summary | |
---|---|
String |
getArg(int index)
Get a specific argument. |
List<String> |
getArgs()
Get the whole list of command arguments. |
String |
getBaseCommand()
Get the base command which was called for this sub-command call. |
int |
getIntArg(int index)
Get an argument coerced into an int. |
String |
getJoinedArgsAfter(int index)
Get all the arguments after the specified index joined into a single string. |
org.bukkit.entity.Player |
getPlayer()
Get the player who invoked this. |
org.bukkit.command.CommandSender |
getSender()
Get the CommandSender who invoked this. |
SubCommand |
getSubCommand()
Get the SubCommand that invoked this call. |
int |
numArgs()
How many arguments we got. |
void |
reply(boolean prefix,
String template,
Object... args)
Re |
void |
reply(String template,
Object... args)
Respond to the call, interpolating colors and variables. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CallInfo(org.bukkit.command.CommandSender sender, org.bukkit.entity.Player player, String baseCommand, SubCommand subCommand, List<String> args, FormatConfig formatter)
sender
- The CommandSender who invoked this (can be a console)player
- The Player who invoked this (will be null if a console)baseCommand
- The label of the base command being executed (for reference)subCommand
- The SubCommand we're executing.args
- The command arguments.formatter
- The formatter being used by our MondoCommand.Method Detail |
---|
public org.bukkit.entity.Player getPlayer()
public org.bukkit.command.CommandSender getSender()
public String getArg(int index)
index
- The argument number.
public List<String> getArgs()
public int getIntArg(int index)
index
- the location in the arguments array.
public String getJoinedArgsAfter(int index)
index
- The index to start at (inclusive)
public int numArgs()
public String getBaseCommand()
public SubCommand getSubCommand()
public void reply(String template, Object... args)
template
- A string template. See ChatMagic
documentation for more info.args
- Zero or more arguments to interpolate the template.ChatMagic.colorize(java.lang.String, java.lang.Object...)
public void reply(boolean prefix, String template, Object... args)
prefix
- if True, prefix the message with the formater's prefix.template
- A string template. See ChatMagic
documentation for more info.args
- Zero or more arguments to interpolate the template.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |