use of com.magmaguy.elitemobs.powers.ElitePower in project GDHooks by bloodmc.
the class EliteMobsProvider method getEliteMobContexts.
public Set<Context> getEliteMobContexts(Entity entity, EliteMobEntity eliteMobEntity) {
if (eliteMobEntity == null) {
eliteMobEntity = EntityTracker.getEliteMobEntity(entity);
if (eliteMobEntity == null) {
return Collections.emptySet();
}
}
final Set<Context> contexts = new HashSet<>();
contexts.add(ContextGroups.TARGET_ELITEMOBS);
contexts.add(new Context("elitemobs_level", String.valueOf(eliteMobEntity.getLevel())));
contexts.add(new Context("elitemobs_has_special_loot", String.valueOf(eliteMobEntity.getHasSpecialLoot())));
contexts.add(new Context("regional_boss", String.valueOf(eliteMobEntity.isRegionalBoss())));
// add powers
for (ElitePower power : eliteMobEntity.getPowers()) {
contexts.add(new Context("elitemobs_power", power.getName().toLowerCase()));
}
if (eliteMobEntity.customBossEntity != null) {
contexts.add(new Context("elitemobs_type", eliteMobEntity.customBossEntity.customBossConfigFields.getFileName().replace(".yml", "").toLowerCase()));
if (eliteMobEntity.customBossEntity.customBossMount != null) {
contexts.add(new Context("elitemobs_mount", eliteMobEntity.customBossEntity.customBossMount.customBossConfigFields.getFileName().replace(".yml", "").toLowerCase()));
}
} else {
contexts.add(ELITE_TYPE);
}
return contexts;
}
Aggregations