Class ADPMainCommand

    • Field Detail

      • plugin

        @NotNull
        protected final @NotNull ADPPlugin plugin
      • command

        @NotNull
        protected final @NotNull ADPCommand command
      • commandName

        @NotNull
        protected final @NotNull String commandName
      • executableByConsole

        protected final boolean executableByConsole
      • listedInHelp

        protected boolean listedInHelp
      • description

        protected String description
      • syntax

        protected String syntax
      • runCommand

        protected String runCommand
      • tabSupport

        protected boolean tabSupport
        Enable tab support for this command
    • Constructor Detail

      • ADPMainCommand

        public ADPMainCommand()
    • Method Detail

      • onCommand

        public abstract boolean onCommand​(@NotNull
                                          @NotNull User sender,
                                          String command,
                                          String[] args)
        Handle the command
        Parameters:
        sender - the user that sent the command
        command - the command performed
        args - arguments of the command
        Returns:
        true if has been handled
      • onTabComplete

        @NotNull
        public @NotNull List<String> onTabComplete​(@NotNull
                                                   @NotNull User sender,
                                                   String[] args)
        Handle tab complete event
        Parameters:
        sender - the user that send the tab complete
        args - arguments of the tab complete
        Returns:
        a list of strings to tab complete
      • register

        public final void register​(@NotNull
                                   @NotNull ADPSubCommand subCommand)
        Register the sub command into the list
        Parameters:
        subCommand - the sub command to register
      • exists

        public final boolean exists​(@NotNull
                                    @NotNull String command)
        Does the given command exist?
        Parameters:
        command - the command name
        Returns:
        true if the command exists
      • getSubCommand

        @Nullable
        protected final @Nullable ADPSubCommand getSubCommand​(@NotNull
                                                              @NotNull String command)
        Get sub command with given name
        Parameters:
        command - the command name
        Returns:
        the sub command found