Search in sources :

Example 6 with Expansion

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

the class ListenerDamage method isDisabled.

private boolean isDisabled(DamageCause damageCause) {
    Expansion expansion = getExpansion();
    ConfigurationManager configurationManager = expansion.getConfigurationManager();
    YamlConfiguration configuration = configurationManager.get("config.yml");
    if (configuration.getBoolean("all-damage"))
        return false;
    String damageCauseName = damageCause.name().toLowerCase();
    return !configuration.getBoolean("damage-type." + damageCauseName);
}
Also used : YamlConfiguration(org.bukkit.configuration.file.YamlConfiguration) Expansion(com.github.sirblobman.combatlogx.api.expansion.Expansion) DamageTaggerExpansion(combatlogx.expansion.damage.tagger.DamageTaggerExpansion) ConfigurationManager(com.github.sirblobman.api.configuration.ConfigurationManager)

Example 7 with Expansion

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

the class LandsExpansion method afterEnable.

@Override
public void afterEnable() {
    ICombatLogX plugin = getPlugin();
    ExpansionManager expansionManager = plugin.getExpansionManager();
    Optional<Expansion> optionalNewbieHelper = expansionManager.getExpansion("NewbieHelper");
    if (optionalNewbieHelper.isPresent()) {
        new ListenerLands(this).register();
    }
}
Also used : ListenerLands(combatlogx.expansion.compatibility.region.lands.listener.ListenerLands) 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)

Example 8 with Expansion

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

the class HookMVdWPlaceholderAPI method getNewbieHelperPVPStatus.

private String getNewbieHelperPVPStatus(Player player) {
    ICombatLogX plugin = this.expansion.getPlugin();
    LanguageManager languageManager = plugin.getLanguageManager();
    boolean pvp = true;
    Expansion expansion = getNewbieHelper();
    if (expansion != null) {
        NewbieHelperExpansion newbieHelperExpansion = (NewbieHelperExpansion) expansion;
        PVPManager pvpManager = newbieHelperExpansion.getPVPManager();
        pvp = !pvpManager.isDisabled(player);
    }
    String messagePath = ("placeholder.pvp-status." + (pvp ? "enabled" : "disabled"));
    return languageManager.getMessage(player, messagePath, null, true);
}
Also used : NewbieHelperExpansion(combatlogx.expansion.newbie.helper.NewbieHelperExpansion) PVPManager(combatlogx.expansion.newbie.helper.manager.PVPManager) LanguageManager(com.github.sirblobman.api.language.LanguageManager) ICombatLogX(com.github.sirblobman.combatlogx.api.ICombatLogX) NewbieHelperExpansion(combatlogx.expansion.newbie.helper.NewbieHelperExpansion) Expansion(com.github.sirblobman.combatlogx.api.expansion.Expansion)

Example 9 with Expansion

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

the class CommandCombatLogXVersion method addExpansionInformation.

private void addExpansionInformation(List<String> messageList) {
    ExpansionManager expansionManager = getExpansionManager();
    List<Expansion> enabledExpansionList = expansionManager.getEnabledExpansions();
    int enabledExpansionListSize = enabledExpansionList.size();
    messageList.add("&f&lEnabled Expansions (&7" + enabledExpansionListSize + "&f&l):");
    for (Expansion expansion : enabledExpansionList) {
        String expansionName = expansion.getName();
        messageList.add("&f&l - &7" + expansionName);
    }
}
Also used : ExpansionManager(com.github.sirblobman.combatlogx.api.expansion.ExpansionManager) Expansion(com.github.sirblobman.combatlogx.api.expansion.Expansion)

Example 10 with Expansion

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

Aggregations

Expansion (com.github.sirblobman.combatlogx.api.expansion.Expansion)32 ConfigurationManager (com.github.sirblobman.api.configuration.ConfigurationManager)19 YamlConfiguration (org.bukkit.configuration.file.YamlConfiguration)9 ICombatLogX (com.github.sirblobman.combatlogx.api.ICombatLogX)8 ExpansionManager (com.github.sirblobman.combatlogx.api.expansion.ExpansionManager)8 NewbieHelperExpansion (combatlogx.expansion.newbie.helper.NewbieHelperExpansion)7 LoggerExpansion (combatlogx.expansion.logger.LoggerExpansion)4 State (com.github.sirblobman.combatlogx.api.expansion.Expansion.State)3 PlaceholderExpansion (me.clip.placeholderapi.expansion.PlaceholderExpansion)3 LanguageManager (com.github.sirblobman.api.language.LanguageManager)2 RegionExpansion (com.github.sirblobman.combatlogx.api.expansion.region.RegionExpansion)2 MobTaggerExpansion (combatlogx.expansion.mob.tagger.MobTaggerExpansion)2 PVPManager (combatlogx.expansion.newbie.helper.manager.PVPManager)2 ProtectionManager (combatlogx.expansion.newbie.helper.manager.ProtectionManager)2 SimpleDateFormat (java.text.SimpleDateFormat)2 Date (java.util.Date)2 HashSet (java.util.HashSet)2 Replacer (com.github.sirblobman.api.language.Replacer)1 MessageUtility (com.github.sirblobman.api.utility.MessageUtility)1 CombatLogCommand (com.github.sirblobman.combatlogx.api.command.CombatLogCommand)1