summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/bukkit/command/TabCompleter.java
blob: 3752ba9fa2b2fcdb083556aea3e0bffac6b4f96e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package org.bukkit.command;

import java.util.List;

/**
 * Represents a class which can suggest tab completions for commands.
 */
public interface TabCompleter {

    /**
     * Requests a list of possible completions for a command argument.
     *
     * @param sender Source of the command.  For players tab-completing a
     *     command inside of a command block, this will be the player, not
     *     the command block. 
     * @param command Command which was executed
     * @param alias The alias used
     * @param args The arguments passed to the command, including final
     *     partial argument to be completed and command label
     * @return A List of possible completions for the final argument, or null
     *     to default to the command executor
     */
    public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args);
}