mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-23 02:55:40 +01:00
Throw error if requirement quest name is unknown, fixes #1502
This commit is contained in:
parent
b7a8d25f60
commit
7cbbd6396b
@ -1796,7 +1796,12 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
||||
final String name2 = config.getString("quests." + id + ".name");
|
||||
if (name2.equalsIgnoreCase(name)
|
||||
|| ChatColor.stripColor(name2).equalsIgnoreCase(ChatColor.stripColor(name))) {
|
||||
if (getQuest(name) != null) {
|
||||
temp.add(getQuest(name));
|
||||
} else {
|
||||
throw new QuestFormatException("Requirement quest-blocks has unknown quest name "
|
||||
+ failedQuest, questKey);
|
||||
}
|
||||
done = true;
|
||||
break;
|
||||
}
|
||||
@ -1827,7 +1832,12 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
||||
final String name2 = config.getString("quests." + id + ".name");
|
||||
if (name2.equalsIgnoreCase(name)
|
||||
|| ChatColor.stripColor(name2).equalsIgnoreCase(ChatColor.stripColor(name))) {
|
||||
if (getQuest(name) != null) {
|
||||
temp.add(getQuest(name));
|
||||
} else {
|
||||
throw new QuestFormatException("Requirement quests has unknown quest name "
|
||||
+ failedQuest, questKey);
|
||||
}
|
||||
done = true;
|
||||
break;
|
||||
}
|
||||
@ -1840,7 +1850,8 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
||||
}
|
||||
reqs.setNeededQuests(temp);
|
||||
if (failed) {
|
||||
throw new QuestFormatException("Requirement quests has invalid quest name " + failedQuest, questKey);
|
||||
throw new QuestFormatException("Requirement quests has invalid quest name "
|
||||
+ failedQuest, questKey);
|
||||
}
|
||||
} else {
|
||||
throw new QuestFormatException("Requirement quests is not a list of quest names", questKey);
|
||||
|
Loading…
Reference in New Issue
Block a user