Implement tab completion for seen and whois. (#1440)

This commit is contained in:
flcmc 2017-08-12 09:42:57 -04:00 committed by Ali 'SupaHam' M
parent 13fbd31124
commit 1562a8f3ca
2 changed files with 21 additions and 0 deletions

View File

@ -16,6 +16,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import java.util.Collections;
import static com.earth2me.essentials.I18n.tl;
@ -210,4 +211,13 @@ public class Commandseen extends EssentialsCommand {
});
}
@Override
protected List<String> getTabCompleteOptions(Server server, CommandSource sender, String commandLabel, String[] args) {
if (args.length == 1) {
return getPlayers(server, sender);
} else {
return Collections.emptyList();
}
}
}

View File

@ -9,6 +9,8 @@ import org.bukkit.Server;
import org.bukkit.Statistic;
import java.util.Locale;
import java.util.Collections;
import java.util.List;
import static com.earth2me.essentials.I18n.tl;
@ -57,4 +59,13 @@ public class Commandwhois extends EssentialsCommand {
sender.sendMessage(tl("whoisMuted", (user.isMuted() ? user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) : tl("true") : tl("false"))));
}
@Override
protected List<String> getTabCompleteOptions(Server server, CommandSource sender, String commandLabel, String[] args) {
if (args.length == 1) {
return getPlayers(server, sender);
} else {
return Collections.emptyList();
}
}
}