Search in sources :

Example 1 with QuestAcceptEvent

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;
}
Also used : EventCaller(com.magmaguy.elitemobs.utils.EventCaller) QuestAcceptEvent(com.magmaguy.elitemobs.api.QuestAcceptEvent)

Aggregations

QuestAcceptEvent (com.magmaguy.elitemobs.api.QuestAcceptEvent)1 EventCaller (com.magmaguy.elitemobs.utils.EventCaller)1