Search in sources :

Example 1 with ElitePower

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;
}
Also used : Context(com.griefdefender.api.permission.Context) HashSet(java.util.HashSet) ElitePower(com.magmaguy.elitemobs.powers.ElitePower)

Aggregations

Context (com.griefdefender.api.permission.Context)1 ElitePower (com.magmaguy.elitemobs.powers.ElitePower)1 HashSet (java.util.HashSet)1