Search in sources :

Example 26 with ExpansionManager

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

the class ListenerLands method getNewbieHelperExpansion.

private NewbieHelperExpansion getNewbieHelperExpansion() {
    ICombatLogX combatLogX = getCombatLogX();
    ExpansionManager expansionManager = combatLogX.getExpansionManager();
    Optional<Expansion> optionalExpansion = expansionManager.getExpansion("NewbieHelper");
    if (!optionalExpansion.isPresent()) {
        throw new IllegalArgumentException("NewbieHelper expansion is missing.");
    }
    Expansion expansion = optionalExpansion.get();
    if (!(expansion instanceof NewbieHelperExpansion)) {
        throw new IllegalArgumentException("NewbieHelper expansion is not a proper instance.");
    }
    return (NewbieHelperExpansion) expansion;
}
Also used : NewbieHelperExpansion(combatlogx.expansion.newbie.helper.NewbieHelperExpansion) ExpansionManager(com.github.sirblobman.combatlogx.api.expansion.ExpansionManager) ICombatLogX(com.github.sirblobman.combatlogx.api.ICombatLogX) Expansion(com.github.sirblobman.combatlogx.api.expansion.Expansion) LandsExpansion(combatlogx.expansion.compatibility.region.lands.LandsExpansion) NewbieHelperExpansion(combatlogx.expansion.newbie.helper.NewbieHelperExpansion)

Example 27 with ExpansionManager

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

the class LibsDisguisesExpansion method onEnable.

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

Example 28 with ExpansionManager

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

the class HookMVdWPlaceholderAPI method getNewbieHelper.

private Expansion getNewbieHelper() {
    ICombatLogX plugin = this.expansion.getPlugin();
    ExpansionManager expansionManager = plugin.getExpansionManager();
    Optional<Expansion> optionalExpansion = expansionManager.getExpansion("NewbieHelper");
    if (optionalExpansion.isPresent()) {
        Expansion expansion = optionalExpansion.get();
        State state = expansion.getState();
        if (state == State.ENABLED)
            return expansion;
    }
    return null;
}
Also used : ExpansionManager(com.github.sirblobman.combatlogx.api.expansion.ExpansionManager) State(com.github.sirblobman.combatlogx.api.expansion.Expansion.State) ICombatLogX(com.github.sirblobman.combatlogx.api.ICombatLogX) NewbieHelperExpansion(combatlogx.expansion.newbie.helper.NewbieHelperExpansion) Expansion(com.github.sirblobman.combatlogx.api.expansion.Expansion)

Example 29 with ExpansionManager

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

the class MVdWPlaceholderAPIExpansion method onEnable.

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

Example 30 with ExpansionManager

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

the class ASkyBlockExpansion method onEnable.

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

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