# MCommand
Date: 2018-12-06

com.massivecraft.factions.zcore

## Class MCommand<T extends MPlugin>

- java.lang.Object
- - com.massivecraft.factions.zcore.MCommand<T>

Direct Known Subclasses:
  CmdAutoHelp, FCommand

    public abstract class MCommand<T extends MPlugin>
    extends java.lang.Object

### Field Summary

Fields
`java.util.List<java.lang.String>` `aliases`
`boolean` `allowNoSlashAccess`
`java.util.List<java.lang.String>` `args`
`java.util.List<MCommand<?>>` `commandChain`
`boolean` `errorOnToManyArgs`
`java.util.List<java.lang.String>` `helpLong`
`org.bukkit.entity.Player` `me`
`java.util.LinkedHashMap<java.lang.String,java.lang.String>` `optionalArgs`
`T` `p`
`java.lang.String` `permission`
`java.util.List<java.lang.String>` `requiredArgs`
`org.bukkit.command.CommandSender` `sender`
`boolean` `senderIsConsole`
`boolean` `senderMustBePlayer`
`java.util.List<MCommand<?>>` `subCommands`
`CommandVisibility` `visibility`

### Constructor Summary

Constructors
Constructor and Description
`MCommand(T p)`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`void` `addSubCommand(MCommand<?> subCommand)`
`org.bukkit.entity.Player` `argAsBestPlayerMatch(int idx)`
`org.bukkit.entity.Player` `argAsBestPlayerMatch(int idx, org.bukkit.entity.Player def)`
`org.bukkit.entity.Player` `argAsBestPlayerMatch(int idx, org.bukkit.entity.Player def, boolean msg)`
`java.lang.Boolean` `argAsBool(int idx)`
`java.lang.Boolean` `argAsBool(int idx, boolean def)`
`java.lang.Double` `argAsDouble(int idx)`
`java.lang.Double` `argAsDouble(int idx, java.lang.Double def)`
`java.lang.Integer` `argAsInt(int idx)`
`java.lang.Integer` `argAsInt(int idx, java.lang.Integer def)`
`org.bukkit.entity.Player` `argAsPlayer(int idx)`
`org.bukkit.entity.Player` `argAsPlayer(int idx, org.bukkit.entity.Player def)`
`org.bukkit.entity.Player` `argAsPlayer(int idx, org.bukkit.entity.Player def, boolean msg)`
`java.lang.String` `argAsString(int idx)`
`java.lang.String` `argAsString(int idx, java.lang.String def)`
`boolean` `argIsSet(int idx)`
`void` `execute(org.bukkit.command.CommandSender sender, java.util.List<java.lang.String> args)`
`void` `execute(org.bukkit.command.CommandSender sender, java.util.List<java.lang.String> args, java.util.List<MCommand<?>> commandChain)`
`java.lang.String` `getHelpShort()`
`java.util.List<java.lang.String>` `getToolTips(Faction faction)`
`java.util.List<java.lang.String>` `getToolTips(FPlayer player)`
`abstract TL` `getUsageTranslation()`
`java.lang.String` `getUseageTemplate()`
`java.lang.String` `getUseageTemplate(boolean addShortHelp)`
`java.lang.String` `getUseageTemplate(java.util.List<MCommand<?>> commandChain, boolean addShortHelp)`
`boolean` `isEnabled()`
`void` `msg(java.lang.String str, java.lang.Object... args)`
`void` `msg(TL translation, java.lang.Object... args)`
`abstract void` `perform()`
`java.lang.String` `replaceFactionTags(java.lang.String s, Faction faction)`
`java.lang.String` `replaceFPlayerTags(java.lang.String s, FPlayer player)`
`void` `sendFancyMessage(mkremins.fanciful.FancyMessage message)`
`void` `sendFancyMessage(java.util.List<mkremins.fanciful.FancyMessage> messages)`
`void` `sendMessage(java.util.List<java.lang.String> msgs)`
`void` `sendMessage(java.lang.String msg)`
`void` `setHelpShort(java.lang.String val)`
`org.bukkit.entity.Player` `strAsBestPlayerMatch(java.lang.String name, org.bukkit.entity.Player def, boolean msg)`
`java.lang.Boolean` `strAsBool(java.lang.String str)`
`java.lang.Double` `strAsDouble(java.lang.String str, java.lang.Double def)`
`java.lang.Integer` `strAsInt(java.lang.String str, java.lang.Integer def)`
`org.bukkit.entity.Player` `strAsPlayer(java.lang.String name, org.bukkit.entity.Player def, boolean msg)`
`boolean` `validArgs(java.util.List<java.lang.String> args)`
`boolean` `validArgs(java.util.List<java.lang.String> args, org.bukkit.command.CommandSender sender)`
`boolean` `validCall(org.bukkit.command.CommandSender sender, java.util.List<java.lang.String> args)` In this method we validate that all prerequisites to perform this command has been met.
`boolean` `validSenderPermissions(org.bukkit.command.CommandSender sender, boolean informSenderIfNot)`
`boolean` `validSenderType(org.bukkit.command.CommandSender sender, boolean informSenderIfNot)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### p

    public T extends MPlugin p

#### subCommands

    public java.util.List<MCommand<?>> subCommands

#### aliases

    public java.util.List<java.lang.String> aliases

#### allowNoSlashAccess

    public boolean allowNoSlashAccess

#### requiredArgs

    public java.util.List<java.lang.String> requiredArgs

#### optionalArgs

    public java.util.LinkedHashMap<java.lang.String,java.lang.String> optionalArgs

#### errorOnToManyArgs

    public boolean errorOnToManyArgs

#### helpLong

    public java.util.List<java.lang.String> helpLong

#### visibility

    public CommandVisibility visibility

#### senderMustBePlayer

    public boolean senderMustBePlayer

#### permission

    public java.lang.String permission

#### sender

    public org.bukkit.command.CommandSender sender

#### me

    public org.bukkit.entity.Player me

#### senderIsConsole

    public boolean senderIsConsole

#### args

    public java.util.List<java.lang.String> args

#### commandChain

    public java.util.List<MCommand<?>> commandChain

### Constructor Detail

#### MCommand

    public MCommand(T p)

### Method Detail

#### addSubCommand

    public void addSubCommand(MCommand<?> subCommand)

#### getHelpShort

    public java.lang.String getHelpShort()

#### setHelpShort

    public void setHelpShort(java.lang.String val)

#### getUsageTranslation

    public abstract TL getUsageTranslation()

#### execute

    public void execute(org.bukkit.command.CommandSender sender,
                        java.util.List<java.lang.String> args,
                        java.util.List<MCommand<?>> commandChain)

#### execute

    public void execute(org.bukkit.command.CommandSender sender,
                        java.util.List<java.lang.String> args)

#### perform

    public abstract void perform()

#### validCall

    public boolean validCall(org.bukkit.command.CommandSender sender,
                             java.util.List<java.lang.String> args)

In this method we validate that all prerequisites to perform this command has been met.

Parameters:
  `sender` - of the command
  `args` - of the command
Returns:
  true if valid, false if not.

#### isEnabled

    public boolean isEnabled()

#### validSenderType

    public boolean validSenderType(org.bukkit.command.CommandSender sender,
                                   boolean informSenderIfNot)

#### validSenderPermissions

    public boolean validSenderPermissions(org.bukkit.command.CommandSender sender,
                                          boolean informSenderIfNot)

#### validArgs

    public boolean validArgs(java.util.List<java.lang.String> args,
                             org.bukkit.command.CommandSender sender)

#### validArgs

    public boolean validArgs(java.util.List<java.lang.String> args)

#### getUseageTemplate

    public java.lang.String getUseageTemplate(java.util.List<MCommand<?>> commandChain,
                                              boolean addShortHelp)

#### getUseageTemplate

    public java.lang.String getUseageTemplate(boolean addShortHelp)

#### getUseageTemplate

    public java.lang.String getUseageTemplate()

#### msg

    public void msg(java.lang.String str,
                    java.lang.Object... args)

#### msg

    public void msg(TL translation,
                    java.lang.Object... args)

#### sendMessage

    public void sendMessage(java.lang.String msg)

#### sendMessage

    public void sendMessage(java.util.List<java.lang.String> msgs)

#### sendFancyMessage

    public void sendFancyMessage(mkremins.fanciful.FancyMessage message)

#### sendFancyMessage

    public void sendFancyMessage(java.util.List<mkremins.fanciful.FancyMessage> messages)

#### getToolTips

    public java.util.List<java.lang.String> getToolTips(FPlayer player)

#### getToolTips

    public java.util.List<java.lang.String> getToolTips(Faction faction)

#### replaceFPlayerTags

    public java.lang.String replaceFPlayerTags(java.lang.String s,
                                               FPlayer player)

#### replaceFactionTags

    public java.lang.String replaceFactionTags(java.lang.String s,
                                               Faction faction)

#### argIsSet

    public boolean argIsSet(int idx)

#### argAsString

    public java.lang.String argAsString(int idx,
                                        java.lang.String def)

#### argAsString

    public java.lang.String argAsString(int idx)

#### strAsInt

    public java.lang.Integer strAsInt(java.lang.String str,
                                      java.lang.Integer def)

#### argAsInt

    public java.lang.Integer argAsInt(int idx,
                                      java.lang.Integer def)

#### argAsInt

    public java.lang.Integer argAsInt(int idx)

#### strAsDouble

    public java.lang.Double strAsDouble(java.lang.String str,
                                        java.lang.Double def)

#### argAsDouble

    public java.lang.Double argAsDouble(int idx,
                                        java.lang.Double def)

#### argAsDouble

    public java.lang.Double argAsDouble(int idx)

#### strAsBool

    public java.lang.Boolean strAsBool(java.lang.String str)

#### argAsBool

    public java.lang.Boolean argAsBool(int idx,
                                       boolean def)

#### argAsBool

    public java.lang.Boolean argAsBool(int idx)

#### strAsPlayer

    public org.bukkit.entity.Player strAsPlayer(java.lang.String name,
                                                org.bukkit.entity.Player def,
                                                boolean msg)

#### argAsPlayer

    public org.bukkit.entity.Player argAsPlayer(int idx,
                                                org.bukkit.entity.Player def,
                                                boolean msg)

#### argAsPlayer

    public org.bukkit.entity.Player argAsPlayer(int idx,
                                                org.bukkit.entity.Player def)

#### argAsPlayer

    public org.bukkit.entity.Player argAsPlayer(int idx)

#### strAsBestPlayerMatch

    public org.bukkit.entity.Player strAsBestPlayerMatch(java.lang.String name,
                                                         org.bukkit.entity.Player def,
                                                         boolean msg)

#### argAsBestPlayerMatch

    public org.bukkit.entity.Player argAsBestPlayerMatch(int idx,
                                                         org.bukkit.entity.Player def,
                                                         boolean msg)

#### argAsBestPlayerMatch

    public org.bukkit.entity.Player argAsBestPlayerMatch(int idx,
                                                         org.bukkit.entity.Player def)

#### argAsBestPlayerMatch

    public org.bukkit.entity.Player argAsBestPlayerMatch(int idx)