Permit yes/no input from source or client, fixes #2117

This commit is contained in:
PikaMug 2023-06-07 18:09:48 -04:00
parent 90bf028624
commit af1469a913
3 changed files with 6 additions and 4 deletions

View File

@ -316,7 +316,7 @@ public class Lang {
}
}
private static class LangToken {
public static class LangToken {
static Map<String, String> tokenMap = new HashMap<>();

View File

@ -730,6 +730,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
}
final Player player = (Player) context.getForWhom();
if (input.equalsIgnoreCase("1") || input.equalsIgnoreCase("y")
|| input.equalsIgnoreCase(Lang.get("yesWord"))
|| input.equalsIgnoreCase(Lang.get(player, "yesWord"))) {
final IQuester quester = getQuester(player.getUniqueId());
final String questIdToTake = quester.getQuestIdToTake();
@ -743,7 +744,8 @@ public class Quests extends JavaPlugin implements QuestsAPI {
}
return Prompt.END_OF_CONVERSATION;
} else if (input.equalsIgnoreCase("2") || input.equalsIgnoreCase("n")
|| input.equalsIgnoreCase(Lang.get("noWord"))) {
|| input.equalsIgnoreCase(Lang.get("noWord"))
|| input.equalsIgnoreCase(Lang.get(player, "noWord"))) {
Lang.send(player, ChatColor.YELLOW + Lang.get("cancelled"));
return Prompt.END_OF_CONVERSATION;
} else {

View File

@ -117,7 +117,7 @@ public class QuestAbandonPrompt extends MiscStringPrompt {
}
final Player player = (Player) context.getForWhom();
if (input.equalsIgnoreCase("1") || input.equalsIgnoreCase("y")
|| input.equalsIgnoreCase(Lang.get(player, "yesWord"))) {
|| input.equalsIgnoreCase(Lang.get("yesWord")) || input.equalsIgnoreCase(Lang.get(player, "yesWord"))) {
final IQuester quester = plugin.getQuester(player.getUniqueId());
if (quester == null) {
plugin.getLogger().info("Ended conversation because quester for " + getName() + "was null");
@ -141,7 +141,7 @@ public class QuestAbandonPrompt extends MiscStringPrompt {
}
return Prompt.END_OF_CONVERSATION;
} else if (input.equalsIgnoreCase("2") || input.equalsIgnoreCase("n")
|| input.equalsIgnoreCase(Lang.get("noWord"))) {
|| input.equalsIgnoreCase(Lang.get("noWord")) || input.equalsIgnoreCase(Lang.get(player, "noWord"))) {
Lang.send(player, ChatColor.YELLOW + Lang.get("cancelled"));
return Prompt.END_OF_CONVERSATION;
} else {