Search in sources :

Example 1 with RegionHandler

use of com.github.sirblobman.combatlogx.api.expansion.region.RegionHandler in project CombatLogX by SirBlobman.

the class ListenerForceField method isSafe.

private boolean isSafe(Player player, Location location, TagType tagType) {
    ICombatLogX plugin = getCombatLogX();
    ExpansionManager expansionManager = plugin.getExpansionManager();
    List<Expansion> enabledExpansionList = expansionManager.getEnabledExpansions();
    for (Expansion expansion : enabledExpansionList) {
        if (expansion instanceof RegionExpansion) {
            RegionExpansion regionExpansion = (RegionExpansion) expansion;
            RegionHandler regionHandler = regionExpansion.getRegionHandler();
            if (regionHandler.isSafeZone(player, location, tagType)) {
                return true;
            }
        }
    }
    return false;
}
Also used : RegionExpansion(com.github.sirblobman.combatlogx.api.expansion.region.RegionExpansion) RegionHandler(com.github.sirblobman.combatlogx.api.expansion.region.RegionHandler) ExpansionManager(com.github.sirblobman.combatlogx.api.expansion.ExpansionManager) ICombatLogX(com.github.sirblobman.combatlogx.api.ICombatLogX) RegionExpansion(com.github.sirblobman.combatlogx.api.expansion.region.RegionExpansion) Expansion(com.github.sirblobman.combatlogx.api.expansion.Expansion) ForceFieldExpansion(combatlogx.expansion.force.field.ForceFieldExpansion)

Aggregations

ICombatLogX (com.github.sirblobman.combatlogx.api.ICombatLogX)1 Expansion (com.github.sirblobman.combatlogx.api.expansion.Expansion)1 ExpansionManager (com.github.sirblobman.combatlogx.api.expansion.ExpansionManager)1 RegionExpansion (com.github.sirblobman.combatlogx.api.expansion.region.RegionExpansion)1 RegionHandler (com.github.sirblobman.combatlogx.api.expansion.region.RegionHandler)1 ForceFieldExpansion (combatlogx.expansion.force.field.ForceFieldExpansion)1