From 791f95491d74ddcf34afed882b1b0a6750bc5086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Mon, 24 Oct 2022 22:19:29 +0200 Subject: [PATCH] Add pronouns auto-completion to tab completer --- .../wtf/beatrice/nounspicker/objects/TabCompletion.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/wtf/beatrice/nounspicker/objects/TabCompletion.java b/src/main/java/wtf/beatrice/nounspicker/objects/TabCompletion.java index f4e4327..e533cd1 100644 --- a/src/main/java/wtf/beatrice/nounspicker/objects/TabCompletion.java +++ b/src/main/java/wtf/beatrice/nounspicker/objects/TabCompletion.java @@ -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); + } }