mirror of
https://github.com/PikaMug/Quests.git
synced 2025-02-12 18:41:22 +01:00
Specify invalid NPC ID on QuestFormatException, per #1614
This commit is contained in:
parent
824c3a237d
commit
5603d514be
@ -1654,14 +1654,12 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
||||
throw new QuestFormatException("finish-message is missing", questKey);
|
||||
}
|
||||
if (depends.getCitizens() != null && config.contains("quests." + questKey + ".npc-giver-id")) {
|
||||
if (CitizensAPI.getNPCRegistry().getById(config.getInt("quests." + questKey + ".npc-giver-id"))
|
||||
!= null) {
|
||||
quest.npcStart = CitizensAPI.getNPCRegistry().getById(config.getInt("quests." + questKey
|
||||
+ ".npc-giver-id"));
|
||||
questNpcs.add(CitizensAPI.getNPCRegistry().getById(config.getInt("quests." + questKey
|
||||
+ ".npc-giver-id")));
|
||||
final int npcId = config.getInt("quests." + questKey + ".npc-giver-id");
|
||||
if (CitizensAPI.getNPCRegistry().getById(npcId) != null) {
|
||||
quest.npcStart = CitizensAPI.getNPCRegistry().getById(npcId);
|
||||
questNpcs.add(CitizensAPI.getNPCRegistry().getById(npcId));
|
||||
} else {
|
||||
throw new QuestFormatException("npc-giver-id has invalid NPC ID", questKey);
|
||||
throw new QuestFormatException("npc-giver-id has invalid NPC ID " + npcId, questKey);
|
||||
}
|
||||
}
|
||||
if (config.contains("quests." + questKey + ".block-start")) {
|
||||
|
Loading…
Reference in New Issue
Block a user