Add pronouns auto-completion to tab completer
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Bea 2022-10-24 22:19:29 +02:00
parent 7b3f0941e1
commit 791f95491d

View File

@ -3,6 +3,7 @@ package wtf.beatrice.nounspicker.objects;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.util.StringUtil;
import wtf.beatrice.nounspicker.utils.Cache;
import java.util.ArrayList;
import java.util.List;
@ -28,6 +29,11 @@ public class TabCompletion implements org.bukkit.command.TabCompleter
if(args.length == 1)
{
StringUtil.copyPartialMatches(mainArg, mainSubCommands, completions);
} else if(args.length <= 3)
{
if(args[0].equalsIgnoreCase("set")) {
StringUtil.copyPartialMatches(args[args.length - 1].toLowerCase(), Cache.pronouns, completions);
}
}