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);
}
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;
}
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;
}
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;
}
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());
}
Aggregations