Search in sources :

Example 1 with ExpansionManager

use of com.github.sirblobman.combatlogx.api.expansion.ExpansionManager 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)

Example 2 with ExpansionManager

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

the class GlowingExpansion method onEnable.

@Override
public void onEnable() {
    Logger logger = getLogger();
    ICombatLogX plugin = getPlugin();
    ExpansionManager expansionManager = plugin.getExpansionManager();
    int minorVersion = VersionUtility.getMinorVersion();
    if (minorVersion < 9) {
        logger.warning("This expansion is made for 1.9+");
        expansionManager.disableExpansion(this);
        return;
    }
    new ListenerGlow(this).register();
}
Also used : ListenerGlow(combatlogx.expansion.glowing.listener.ListenerGlow) ExpansionManager(com.github.sirblobman.combatlogx.api.expansion.ExpansionManager) ICombatLogX(com.github.sirblobman.combatlogx.api.ICombatLogX) Logger(java.util.logging.Logger)

Example 3 with ExpansionManager

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

the class LootProtectionExpansion method onEnable.

@Override
public void onEnable() {
    int minorVersion = VersionUtility.getMinorVersion();
    if (minorVersion < 16) {
        Logger logger = getLogger();
        logger.info("The loot protection expansion requires Spigot 1.16.5 or higher.");
        ICombatLogX plugin = getPlugin();
        ExpansionManager expansionManager = plugin.getExpansionManager();
        expansionManager.disableExpansion(this);
        return;
    }
    new ListenerLootProtection(this).register();
}
Also used : ExpansionManager(com.github.sirblobman.combatlogx.api.expansion.ExpansionManager) ICombatLogX(com.github.sirblobman.combatlogx.api.ICombatLogX) Logger(java.util.logging.Logger) ListenerLootProtection(combatlogx.expansion.loot.protection.listener.ListenerLootProtection)

Example 4 with ExpansionManager

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

the class DisguiseExpansion method onEnable.

@Override
public void onEnable() {
    if (!checkDependency("iDisguise", true, "5.8")) {
        ExpansionManager expansionManager = getPlugin().getExpansionManager();
        expansionManager.disableExpansion(this);
        return;
    }
    new ListenerDisguise(this).register();
}
Also used : ExpansionManager(com.github.sirblobman.combatlogx.api.expansion.ExpansionManager)

Example 5 with ExpansionManager

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

the class uSkyBlockExpansion method onEnable.

@Override
public void onEnable() {
    if (!checkDependency("uSkyBlock", true)) {
        ICombatLogX plugin = getPlugin();
        ExpansionManager expansionManager = plugin.getExpansionManager();
        expansionManager.disableExpansion(this);
        return;
    }
    new ListeneruSkyBlock(this).register();
}
Also used : ListeneruSkyBlock(combatlogx.expansion.compatibility.uskyblock.listener.ListeneruSkyBlock) ExpansionManager(com.github.sirblobman.combatlogx.api.expansion.ExpansionManager) ICombatLogX(com.github.sirblobman.combatlogx.api.ICombatLogX)

Aggregations

ExpansionManager (com.github.sirblobman.combatlogx.api.expansion.ExpansionManager)33 ICombatLogX (com.github.sirblobman.combatlogx.api.ICombatLogX)24 Expansion (com.github.sirblobman.combatlogx.api.expansion.Expansion)7 Logger (java.util.logging.Logger)4 NewbieHelperExpansion (combatlogx.expansion.newbie.helper.NewbieHelperExpansion)3 ConfigurationManager (com.github.sirblobman.api.configuration.ConfigurationManager)2 LanguageManager (com.github.sirblobman.api.language.LanguageManager)2 State (com.github.sirblobman.combatlogx.api.expansion.Expansion.State)2 RegionExpansion (com.github.sirblobman.combatlogx.api.expansion.region.RegionExpansion)2 CorePlugin (com.github.sirblobman.api.core.CorePlugin)1 UpdateManager (com.github.sirblobman.api.update.UpdateManager)1 RegionHandler (com.github.sirblobman.combatlogx.api.expansion.region.RegionHandler)1 IPunishManager (com.github.sirblobman.combatlogx.api.manager.IPunishManager)1 ITimerManager (com.github.sirblobman.combatlogx.api.manager.ITimerManager)1 CommandCombatTimer (com.github.sirblobman.combatlogx.command.CommandCombatTimer)1 CommandTogglePVP (com.github.sirblobman.combatlogx.command.CommandTogglePVP)1 CommandCombatLogX (com.github.sirblobman.combatlogx.command.combatlogx.CommandCombatLogX)1 ConfigurationChecker (com.github.sirblobman.combatlogx.configuration.ConfigurationChecker)1 ListenerConfiguration (com.github.sirblobman.combatlogx.listener.ListenerConfiguration)1 ListenerDamage (com.github.sirblobman.combatlogx.listener.ListenerDamage)1