Class MCommand<T extends MPlugin>


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

      Constructors 
      Constructor Description
      MCommand​(T p)  
    • Method Summary

      Modifier and Type Method Description
      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​(TL translation, java.lang.Object... args)  
      void msg​(java.lang.String str, 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​(java.util.List<mkremins.fanciful.FancyMessage> messages)  
      void sendFancyMessage​(mkremins.fanciful.FancyMessage message)  
      void sendMessage​(java.lang.String msg)  
      void sendMessage​(java.util.List<java.lang.String> msgs)  
      void setCommandSender​(org.bukkit.command.CommandSender sender)  
      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

      • 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
      • senderMustBePlayer

        public boolean senderMustBePlayer
      • senderMustHaveFaction

        public boolean senderMustHaveFaction
      • 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()
      • setCommandSender

        public void setCommandSender​(org.bukkit.command.CommandSender sender)
      • 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)