mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-11 19:02:02 +01:00
Implement tab completion for seen and whois. (#1440)
This commit is contained in:
parent
13fbd31124
commit
1562a8f3ca
Essentials/src/com/earth2me/essentials/commands
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user