summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/bukkit/command/Command.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/bukkit/command/Command.java')
-rw-r--r--src/main/java/org/bukkit/command/Command.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index a02c28d6..5445882c 100644
--- a/src/main/java/org/bukkit/command/Command.java
+++ b/src/main/java/org/bukkit/command/Command.java
@@ -8,6 +8,7 @@ import java.util.Set;
import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
+import org.bukkit.Location;
import org.bukkit.Server;
import org.bukkit.entity.Player;
import org.bukkit.entity.minecart.CommandMinecart;
@@ -83,6 +84,22 @@ public abstract class Command {
* @throws IllegalArgumentException if sender, alias, or args is null
*/
public List<String> tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException {
+ return tabComplete(sender, alias, args, null);
+ }
+
+ /**
+ * Executed on tab completion for this command, returning a list of
+ * options the player can tab through.
+ *
+ * @param sender Source object which is executing this command
+ * @param alias the alias being used
+ * @param args All arguments passed to the command, split via ' '
+ * @param location The position looked at by the sender, or null if none
+ * @return a list of tab-completions for the specified arguments. This
+ * will never be null. List may be immutable.
+ * @throws IllegalArgumentException if sender, alias, or args is null
+ */
+ public List<String> tabComplete(CommandSender sender, String alias, String[] args, Location location) throws IllegalArgumentException {
Validate.notNull(sender, "Sender cannot be null");
Validate.notNull(args, "Arguments cannot be null");
Validate.notNull(alias, "Alias cannot be null");