mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-21 18:15:32 +01:00
Permit yes/no input from source or client, fixes #2117
This commit is contained in:
parent
90bf028624
commit
af1469a913
@ -316,7 +316,7 @@ public class Lang {
|
||||
}
|
||||
}
|
||||
|
||||
private static class LangToken {
|
||||
public static class LangToken {
|
||||
|
||||
static Map<String, String> tokenMap = new HashMap<>();
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user