Fix compat with older tab completing commands.

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot 2016-08-25 10:36:34 +10:00
parent 359e6edb63
commit 497a87b5b5

View file

@ -84,7 +84,7 @@ 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);
return tabComplete0(sender, alias, args, null);
}
/**
@ -100,6 +100,10 @@ public abstract class Command {
* @throws IllegalArgumentException if sender, alias, or args is null
*/
public List<String> tabComplete(CommandSender sender, String alias, String[] args, Location location) throws IllegalArgumentException {
return tabComplete(sender, alias, args);
}
private List<String> tabComplete0(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");