Class ViaSubCommand


  • public abstract class ViaSubCommand
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ViaSubCommand()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String color​(java.lang.String s)
      Replaces color codes in a string.
      abstract java.lang.String description()
      subcommand description, this'll show in /viaversion list
      abstract boolean execute​(ViaCommandSender sender, java.lang.String[] args)
      Gets triggered on execution
      abstract java.lang.String name()
      Subcommand name
      java.util.List<java.lang.String> onTabComplete​(ViaCommandSender sender, java.lang.String[] args)
      Yay, possibility to implement tab-completion
      java.lang.String permission()
      Permission, null for everyone
      static void sendMessage​(ViaCommandSender sender, java.lang.String message, java.lang.Object... args)
      Send a color coded string with replacements to a user.
      java.lang.String usage()
      Usage example: "playerversion [name]"
      • Methods inherited from class java.lang.Object

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

      • ViaSubCommand

        public ViaSubCommand()
    • Method Detail

      • name

        public abstract java.lang.String name()
        Subcommand name
        Returns:
        The commands name
      • description

        public abstract java.lang.String description()
        subcommand description, this'll show in /viaversion list
        Returns:
        The commands description
      • usage

        public java.lang.String usage()
        Usage example: "playerversion [name]"
        Returns:
        The commands usage
      • permission

        public java.lang.String permission()
        Permission, null for everyone
        Returns:
        The permission required to use the commands
      • execute

        public abstract boolean execute​(ViaCommandSender sender,
                                        java.lang.String[] args)
        Gets triggered on execution
        Parameters:
        sender - Command sender
        args - Arguments
        Returns:
        commands executed succesfully if false, show usage
      • onTabComplete

        public java.util.List<java.lang.String> onTabComplete​(ViaCommandSender sender,
                                                              java.lang.String[] args)
        Yay, possibility to implement tab-completion
        Parameters:
        sender - Command sender
        args - args
        Returns:
        tab complete possibilities
      • color

        public static java.lang.String color​(java.lang.String s)
        Replaces color codes in a string.
        Parameters:
        s - string to replace
        Returns:
        output String
      • sendMessage

        public static void sendMessage​(ViaCommandSender sender,
                                       java.lang.String message,
                                       java.lang.Object... args)
        Send a color coded string with replacements to a user.
        Parameters:
        sender - target to send the message to
        message - message
        args - objects to replace