use of com.magmaguy.elitemobs.api.QuestAcceptEvent in project EliteMobs by MagmaGuy.
the class CustomQuest method startQuest.
public static Quest startQuest(String questID, Player player) {
Quest quest = null;
Developer.message("pending player quests " + pendingPlayerQuests.get(player.getUniqueId()).size());
for (Quest iteratedQuest : pendingPlayerQuests.get(player.getUniqueId())) if (iteratedQuest.getQuestID().equals(UUID.fromString(questID))) {
quest = iteratedQuest;
break;
}
if (quest == null) {
player.sendMessage(ChatColorConverter.convert("&8[EliteMobs] &cInvalid quest ID for ID " + questID));
return null;
}
QuestAcceptEvent questAcceptEvent = new QuestAcceptEvent(player, quest);
new EventCaller(questAcceptEvent);
if (questAcceptEvent.isCancelled())
return null;
return quest;
}
Aggregations