Search in sources :

Example 1 with EventCaller

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

the class Quest method completeQuest.

public static Quest completeQuest(UUID questUUID, Player player) {
    Quest quest = PlayerData.getQuest(player.getUniqueId(), questUUID);
    if (quest == null)
        return null;
    if (!quest.getQuestID().equals(questUUID))
        return null;
    if (!quest.getQuestObjectives().isOver())
        return null;
    QuestCompleteEvent questCompleteEvent = new QuestCompleteEvent(player, quest);
    new EventCaller(questCompleteEvent);
    return quest;
}
Also used : QuestCompleteEvent(com.magmaguy.elitemobs.api.QuestCompleteEvent) EventCaller(com.magmaguy.elitemobs.utils.EventCaller)

Example 2 with EventCaller

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

the class Quest method stopPlayerQuest.

public static void stopPlayerQuest(Player player, String questID) {
    if (PlayerData.getQuests(player.getUniqueId()) == null) {
        player.sendMessage(QuestsConfig.getLeaveWhenNoActiveQuestsExist());
        return;
    }
    QuestLeaveEvent questLeaveEvent = new QuestLeaveEvent(player, PlayerData.getQuest(player.getUniqueId(), questID));
    new EventCaller(questLeaveEvent);
}
Also used : QuestLeaveEvent(com.magmaguy.elitemobs.api.QuestLeaveEvent) EventCaller(com.magmaguy.elitemobs.utils.EventCaller)

Example 3 with EventCaller

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

the class EliteEntity method fullHeal.

public void fullHeal() {
    EliteMobHealEvent eliteMobHealEvent = new EliteMobHealEvent(this, true);
    new EventCaller(eliteMobHealEvent);
    if (eliteMobHealEvent.isCancelled())
        return;
    setHealth(this.maxHealth);
    this.health = maxHealth;
    damagers.clear();
}
Also used : EventCaller(com.magmaguy.elitemobs.utils.EventCaller) EliteMobHealEvent(com.magmaguy.elitemobs.api.EliteMobHealEvent)

Example 4 with EventCaller

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

the class EliteEntity method heal.

public void heal(double healAmount) {
    EliteMobHealEvent eliteMobHealEvent = new EliteMobHealEvent(this, healAmount);
    new EventCaller(eliteMobHealEvent);
    if (eliteMobHealEvent.isCancelled())
        return;
    setHealth(health + healAmount);
}
Also used : EventCaller(com.magmaguy.elitemobs.utils.EventCaller) EliteMobHealEvent(com.magmaguy.elitemobs.api.EliteMobHealEvent)

Example 5 with EventCaller

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

the class EntityTracker method registerSuperMob.

// Super Mobs
public static void registerSuperMob(LivingEntity livingEntity) {
    SuperMobSpawnEvent superMobSpawnEvent = new SuperMobSpawnEvent(livingEntity);
    new EventCaller(superMobSpawnEvent);
    if (superMobSpawnEvent.isCancelled())
        return;
    PersistentTagger.tagSuperMob(livingEntity);
}
Also used : SuperMobSpawnEvent(com.magmaguy.elitemobs.api.SuperMobSpawnEvent) 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