Search in sources :

Example 6 with EventCaller

use of com.magmaguy.elitemobs.utils.EventCaller in project EliteMobs by MagmaGuy.

the class EntityTracker method registerEliteMob.

public static void registerEliteMob(EliteEntity eliteEntity) {
    EliteMobSpawnEvent eliteMobSpawnEvent = new EliteMobSpawnEvent(eliteEntity);
    new EventCaller(eliteMobSpawnEvent);
    if (eliteMobSpawnEvent.isCancelled())
        return;
    PersistentTagger.tagElite(eliteEntity.getLivingEntity(), eliteEntity.getEliteUUID());
    eliteMobEntities.put(eliteEntity.getEliteUUID(), eliteEntity);
}
Also used : EliteMobSpawnEvent(com.magmaguy.elitemobs.api.EliteMobSpawnEvent) EventCaller(com.magmaguy.elitemobs.utils.EventCaller)

Example 7 with EventCaller

use of com.magmaguy.elitemobs.utils.EventCaller 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)

Example 8 with EventCaller

use of com.magmaguy.elitemobs.utils.EventCaller in project EliteMobs by MagmaGuy.

the class Objective method progressNonlinearObjective.

public void progressNonlinearObjective(QuestObjectives questObjectives) {
    QuestProgressionEvent questProgressionEvent = new QuestProgressionEvent(Bukkit.getPlayer(questObjectives.getQuest().getPlayerUUID()), questObjectives.getQuest(), this);
    new EventCaller(questProgressionEvent);
    objectiveCompleted = currentAmount >= targetAmount;
}
Also used : EventCaller(com.magmaguy.elitemobs.utils.EventCaller) QuestProgressionEvent(com.magmaguy.elitemobs.api.QuestProgressionEvent)

Example 9 with EventCaller

use of com.magmaguy.elitemobs.utils.EventCaller in project EliteMobs by MagmaGuy.

the class Minidungeon method initializeRelativeLocationAddition.

public boolean initializeRelativeLocationAddition(CustomBossesConfigFields customBossesConfigFields, Location location) {
    Location relativeLocation = addRelativeLocation(customBossesConfigFields, location);
    NewMinidungeonRelativeBossLocationEvent event = new NewMinidungeonRelativeBossLocationEvent(this, relativeLocation, dungeonPackagerConfigFields.getAnchorPoint().clone().add(Objects.requireNonNull(relativeLocation)), customBossesConfigFields);
    new EventCaller(event);
    if (event.isCancelled())
        return false;
    RegionalBossEntity.createPermanentRegionalBossEntity(customBossesConfigFields, location);
    return true;
}
Also used : EventCaller(com.magmaguy.elitemobs.utils.EventCaller) NewMinidungeonRelativeBossLocationEvent(com.magmaguy.elitemobs.api.internal.NewMinidungeonRelativeBossLocationEvent) Location(org.bukkit.Location)

Example 10 with EventCaller

use of com.magmaguy.elitemobs.utils.EventCaller in project EliteMobs by MagmaGuy.

the class EntityTracker method registerNPCEntity.

public static void registerNPCEntity(NPCEntity npc) {
    NPCEntitySpawnEvent npcEntitySpawnEvent = new NPCEntitySpawnEvent(npc.getVillager(), npc);
    new EventCaller(npcEntitySpawnEvent);
    if (npcEntitySpawnEvent.isCancelled())
        return;
    npcEntities.put(npc.getUuid(), npc);
    PersistentTagger.tagNPC(npc.getVillager(), npc.getUuid());
}
Also used : NPCEntitySpawnEvent(com.magmaguy.elitemobs.api.NPCEntitySpawnEvent) EventCaller(com.magmaguy.elitemobs.utils.EventCaller)

Aggregations

EventCaller (com.magmaguy.elitemobs.utils.EventCaller)12 EliteMobHealEvent (com.magmaguy.elitemobs.api.EliteMobHealEvent)2 QuestProgressionEvent (com.magmaguy.elitemobs.api.QuestProgressionEvent)2 EliteMobSpawnEvent (com.magmaguy.elitemobs.api.EliteMobSpawnEvent)1 NPCEntitySpawnEvent (com.magmaguy.elitemobs.api.NPCEntitySpawnEvent)1 QuestAcceptEvent (com.magmaguy.elitemobs.api.QuestAcceptEvent)1 QuestCompleteEvent (com.magmaguy.elitemobs.api.QuestCompleteEvent)1 QuestLeaveEvent (com.magmaguy.elitemobs.api.QuestLeaveEvent)1 QuestObjectivesCompletedEvent (com.magmaguy.elitemobs.api.QuestObjectivesCompletedEvent)1 SuperMobSpawnEvent (com.magmaguy.elitemobs.api.SuperMobSpawnEvent)1 NewMinidungeonRelativeBossLocationEvent (com.magmaguy.elitemobs.api.internal.NewMinidungeonRelativeBossLocationEvent)1 Location (org.bukkit.Location)1