diff --git a/main/src/main/java/me/blackvein/quests/Quests.java b/main/src/main/java/me/blackvein/quests/Quests.java index d8c1518cb..03fe487c0 100644 --- a/main/src/main/java/me/blackvein/quests/Quests.java +++ b/main/src/main/java/me/blackvein/quests/Quests.java @@ -128,7 +128,7 @@ public class Quests extends JavaPlugin { private final Collection quests = new ConcurrentSkipListSet<>(); private Collection actions = new ConcurrentSkipListSet<>(); private Collection conditions = new ConcurrentSkipListSet<>(); - private LinkedList questNpcs = new LinkedList<>(); + private LinkedList questNpcIds = new LinkedList<>(); private CommandExecutor cmdExecutor; private ConversationFactory conversationFactory; private ConversationFactory npcConversationFactory; @@ -502,12 +502,12 @@ public class Quests extends JavaPlugin { this.questers = new ConcurrentSkipListSet<>(questers); } - public LinkedList getQuestNpcs() { - return questNpcs; + public LinkedList getQuestNpcIds() { + return questNpcIds; } - public void setQuestNpcs(final LinkedList questNpcs) { - this.questNpcs = questNpcs; + public void setQuestNpcIds(final LinkedList questNpcIds) { + this.questNpcIds = questNpcIds; } public CommandExecutor getCommandExecutor() { @@ -1771,7 +1771,7 @@ public class Quests extends JavaPlugin { 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)); + questNpcIds.add(npcId); } else { throw new QuestFormatException("npc-giver-id has invalid NPC ID " + npcId, questKey); } @@ -2834,7 +2834,7 @@ public class Quests extends JavaPlugin { for (final int i : npcIdsToTalkTo) { if (getDependencies().getCitizens() != null) { if (CitizensAPI.getNPCRegistry().getById(i) != null) { - questNpcs.add(CitizensAPI.getNPCRegistry().getById(i)); + questNpcIds.add(i); } else { throw new StageFormatException("npc-ids-to-talk-to has invalid NPC ID of " + i, quest, stageNum); @@ -2957,7 +2957,7 @@ public class Quests extends JavaPlugin { if (npcAmountsToKill.get(npcIdsToKill.indexOf(i)) > 0) { oStage.citizensToKill.add(i); oStage.citizenNumToKill.add(npcAmountsToKill.get(npcIdsToKill.indexOf(i))); - questNpcs.add(CitizensAPI.getNPCRegistry().getById(i)); + questNpcIds.add(i); } else { throw new StageFormatException("npc-kill-amounts is not a positive number", quest, stageNum); diff --git a/main/src/main/java/me/blackvein/quests/listeners/NpcListener.java b/main/src/main/java/me/blackvein/quests/listeners/NpcListener.java index c6e117e91..6c9360020 100644 --- a/main/src/main/java/me/blackvein/quests/listeners/NpcListener.java +++ b/main/src/main/java/me/blackvein/quests/listeners/NpcListener.java @@ -181,7 +181,7 @@ public class NpcListener implements Listener { } } } - if (plugin.getQuestNpcs().contains(evt.getNPC())) { + if (plugin.getQuestNpcIds().contains(evt.getNPC().getId())) { boolean hasObjective = false; for (final Quest quest : quester.getCurrentQuests().keySet()) { if (quester.getCurrentStage(quest).containsObjective(ObjectiveType.TALK_TO_NPC)) {