Search in sources :

Example 86 with ConfigurationManager

use of com.github.sirblobman.api.configuration.ConfigurationManager in project CombatLogX by SirBlobman.

the class ListenerDamage method hasBypassPermission.

private boolean hasBypassPermission(Player player) {
    ConfigurationManager configurationManager = getExpansionConfigurationManager();
    YamlConfiguration configuration = configurationManager.get("config.yml");
    String permissionName = configuration.getString("bypass-permission");
    if (permissionName == null || permissionName.isEmpty()) {
        return false;
    }
    String permissionDescription = "CombatLogX Bypass Permission: Mob Combat";
    Permission permission = new Permission(permissionName, permissionDescription, PermissionDefault.FALSE);
    return player.hasPermission(permission);
}
Also used : Permission(org.bukkit.permissions.Permission) YamlConfiguration(org.bukkit.configuration.file.YamlConfiguration) ConfigurationManager(com.github.sirblobman.api.configuration.ConfigurationManager)

Example 87 with ConfigurationManager

use of com.github.sirblobman.api.configuration.ConfigurationManager in project CombatLogX by SirBlobman.

the class RewardManager method loadRewards.

public void loadRewards() {
    ConfigurationManager configurationManager = this.expansion.getConfigurationManager();
    YamlConfiguration configuration = configurationManager.get("config.yml");
    this.rewardSet.clear();
    ConfigurationSection rewards = configuration.getConfigurationSection("rewards");
    if (rewards == null) {
        Logger logger = this.expansion.getLogger();
        logger.warning("Your config.yml is missing the 'rewards' section. If you don't want any rewards you should remove this expansion.");
        return;
    }
    Set<String> idSet = rewards.getKeys(false);
    for (String id : idSet) {
        ConfigurationSection rewardSection = rewards.getConfigurationSection(id);
        Reward reward = loadReward(id, rewardSection);
        if (reward != null)
            this.rewardSet.add(reward);
    }
    int rewardSetSize = this.rewardSet.size();
    Logger logger = this.expansion.getLogger();
    logger.info("Successfully loaded " + rewardSetSize + " reward" + (rewardSetSize == 1 ? "" : "s") + ".");
}
Also used : Reward(combatlogx.expansion.rewards.object.Reward) YamlConfiguration(org.bukkit.configuration.file.YamlConfiguration) Logger(java.util.logging.Logger) ConfigurationManager(com.github.sirblobman.api.configuration.ConfigurationManager) ConfigurationSection(org.bukkit.configuration.ConfigurationSection)

Example 88 with ConfigurationManager

use of com.github.sirblobman.api.configuration.ConfigurationManager in project CombatLogX by SirBlobman.

the class ScoreboardExpansion method reloadConfig.

@Override
public void reloadConfig() {
    ConfigurationManager configurationManager = getConfigurationManager();
    configurationManager.reload("config.yml");
}
Also used : ConfigurationManager(com.github.sirblobman.api.configuration.ConfigurationManager)

Example 89 with ConfigurationManager

use of com.github.sirblobman.api.configuration.ConfigurationManager in project CombatLogX by SirBlobman.

the class MythicMobsExpansion method onLoad.

@Override
public void onLoad() {
    ConfigurationManager configurationManager = getConfigurationManager();
    configurationManager.saveDefault("config.yml");
}
Also used : ConfigurationManager(com.github.sirblobman.api.configuration.ConfigurationManager)

Example 90 with ConfigurationManager

use of com.github.sirblobman.api.configuration.ConfigurationManager in project CombatLogX by SirBlobman.

the class DamageTaggerExpansion method reloadConfig.

@Override
public void reloadConfig() {
    ConfigurationManager configurationManager = getConfigurationManager();
    configurationManager.reload("config.yml");
}
Also used : ConfigurationManager(com.github.sirblobman.api.configuration.ConfigurationManager)

Aggregations

ConfigurationManager (com.github.sirblobman.api.configuration.ConfigurationManager)117 YamlConfiguration (org.bukkit.configuration.file.YamlConfiguration)62 Expansion (com.github.sirblobman.combatlogx.api.expansion.Expansion)20 ICombatLogX (com.github.sirblobman.combatlogx.api.ICombatLogX)10 PlayerDataManager (com.github.sirblobman.api.configuration.PlayerDataManager)6 LanguageManager (com.github.sirblobman.api.language.LanguageManager)6 Player (org.bukkit.entity.Player)6 EventHandler (org.bukkit.event.EventHandler)6 ICombatManager (com.github.sirblobman.combatlogx.api.manager.ICombatManager)5 Entity (org.bukkit.entity.Entity)4 LoggerExpansion (combatlogx.expansion.logger.LoggerExpansion)3 LivingEntity (org.bukkit.entity.LivingEntity)3 PluginManager (org.bukkit.plugin.PluginManager)3 ExpansionManager (com.github.sirblobman.combatlogx.api.expansion.ExpansionManager)2 IDeathListener (com.github.sirblobman.combatlogx.api.listener.IDeathListener)2 MobTaggerExpansion (combatlogx.expansion.mob.tagger.MobTaggerExpansion)2 ScoreboardExpansion (combatlogx.expansion.scoreboard.ScoreboardExpansion)2 SimpleDateFormat (java.text.SimpleDateFormat)2 Date (java.util.Date)2 UUID (java.util.UUID)2