Class HelpCommand

    • Constructor Detail

      • HelpCommand

        public HelpCommand()
    • Method Detail

      • execute

        public boolean execute​(@NotNull
                               @NotNull CommandSender sender,
                               @NotNull
                               @NotNull String currentAlias,
                               @NotNull
                               @NotNull String[] args)
        Description copied from class: Command
        Executes the command, returning its success
        Specified by:
        execute in class Command
        Parameters:
        sender - Source object which is executing this command
        currentAlias - The alias of the command used
        args - All arguments passed to the command, split via ' '
        Returns:
        true if the command was successful, otherwise false
      • tabComplete

        @NotNull
        public @NotNull List<String> tabComplete​(@NotNull
                                                 @NotNull CommandSender sender,
                                                 @NotNull
                                                 @NotNull String alias,
                                                 @NotNull
                                                 @NotNull String[] args)
        Description copied from class: Command
        Executed on tab completion for this command, returning a list of options the player can tab through.
        Overrides:
        tabComplete in class Command
        Parameters:
        sender - Source object which is executing this command
        alias - the alias being used
        args - All arguments passed to the command, split via ' '
        Returns:
        a list of tab-completions for the specified arguments. This will never be null. List may be immutable.
      • findPossibleMatches

        @Nullable
        protected @Nullable HelpTopic findPossibleMatches​(@NotNull
                                                          @NotNull String searchString)
      • damerauLevenshteinDistance

        protected static int damerauLevenshteinDistance​(@Nullable
                                                        @Nullable String s1,
                                                        @Nullable
                                                        @Nullable String s2)
        Computes the Dameraur-Levenshtein Distance between two strings. Adapted from the algorithm at Wikipedia: Damerau–Levenshtein distance
        Parameters:
        s1 - The first string being compared.
        s2 - The second string being compared.
        Returns:
        The number of substitutions, deletions, insertions, and transpositions required to get from s1 to s2.