Search in sources :

Example 11 with ExpansionManager

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

the class CombatPlugin method onLoad.

@Override
public void onLoad() {
    ConfigurationChecker configurationChecker = new ConfigurationChecker(this);
    configurationChecker.checkVersion();
    ConfigurationManager configurationManager = getConfigurationManager();
    configurationManager.saveDefault("config.yml");
    configurationManager.saveDefault("commands.yml");
    configurationManager.saveDefault("punish.yml");
    LanguageManager languageManager = getLanguageManager();
    languageManager.saveDefaultLanguages();
    languageManager.reloadLanguages();
    ExpansionManager expansionManager = getExpansionManager();
    expansionManager.loadExpansions();
    broadcastLoadMessage();
}
Also used : ConfigurationChecker(com.github.sirblobman.combatlogx.configuration.ConfigurationChecker) ExpansionManager(com.github.sirblobman.combatlogx.api.expansion.ExpansionManager) LanguageManager(com.github.sirblobman.api.language.LanguageManager) ConfigurationManager(com.github.sirblobman.api.configuration.ConfigurationManager)

Example 12 with ExpansionManager

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

the class CombatPlugin method onDisable.

@Override
public void onDisable() {
    untagAllPlayers();
    ExpansionManager expansionManager = getExpansionManager();
    expansionManager.disableExpansions();
    Bukkit.getScheduler().cancelTasks(this);
    HandlerList.unregisterAll(this);
    broadcastDisableMessage();
}
Also used : ExpansionManager(com.github.sirblobman.combatlogx.api.expansion.ExpansionManager)

Example 13 with ExpansionManager

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

the class CommandCombatLogXAbout method getExpansionNames.

private Set<String> getExpansionNames() {
    ExpansionManager expansionManager = getExpansionManager();
    Set<String> expansionNameSet = new HashSet<>();
    List<Expansion> expansionList = expansionManager.getAllExpansions();
    for (Expansion expansion : expansionList) {
        String expansionName = expansion.getName();
        expansionNameSet.add(expansionName);
    }
    return Collections.unmodifiableSet(expansionNameSet);
}
Also used : ExpansionManager(com.github.sirblobman.combatlogx.api.expansion.ExpansionManager) Expansion(com.github.sirblobman.combatlogx.api.expansion.Expansion) HashSet(java.util.HashSet)

Example 14 with ExpansionManager

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

the class ActionBarExpansion method onEnable.

@Override
public void onEnable() {
    ICombatLogX plugin = getPlugin();
    int minorVersion = VersionUtility.getMinorVersion();
    if (minorVersion < 8) {
        Logger logger = getLogger();
        logger.warning("This expansion requires Spigot 1.8.8 or higher.");
        ExpansionManager expansionManager = plugin.getExpansionManager();
        expansionManager.disableExpansion(this);
        return;
    }
    ITimerManager timerManager = plugin.getTimerManager();
    timerManager.addUpdaterTask(new ActionBarUpdater(this));
}
Also used : ITimerManager(com.github.sirblobman.combatlogx.api.manager.ITimerManager) ExpansionManager(com.github.sirblobman.combatlogx.api.expansion.ExpansionManager) ICombatLogX(com.github.sirblobman.combatlogx.api.ICombatLogX) Logger(java.util.logging.Logger)

Example 15 with ExpansionManager

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

the class EssentialsExpansion method onEnable.

@Override
public void onEnable() {
    if (!checkDependency("Essentials", true)) {
        ICombatLogX plugin = getPlugin();
        ExpansionManager expansionManager = plugin.getExpansionManager();
        expansionManager.disableExpansion(this);
        return;
    }
    new ListenerEssentials(this).register();
}
Also used : ListenerEssentials(combatlogx.expansion.compatibility.essentials.listener.ListenerEssentials) 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