Search in sources :

Example 76 with ConfigurationManager

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

the class CombatManager method getMaxTimerSeconds.

@Override
public int getMaxTimerSeconds(Player player) {
    ConfigurationManager configurationManager = this.plugin.getConfigurationManager();
    YamlConfiguration configuration = configurationManager.get("config.yml");
    String timerTypeString = configuration.getString("timer.type");
    TimerType timerType = TimerType.parse(timerTypeString);
    return (timerType == TimerType.PERMISSION ? getPermissionTimerSeconds(player) : getGlobalTimerSeconds());
}
Also used : TimerType(com.github.sirblobman.combatlogx.api.object.TimerType) YamlConfiguration(org.bukkit.configuration.file.YamlConfiguration) ConfigurationManager(com.github.sirblobman.api.configuration.ConfigurationManager)

Example 77 with ConfigurationManager

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

the class CustomScoreboardManager method shouldIgnorePrevious.

private boolean shouldIgnorePrevious() {
    ScoreboardExpansion expansion = getExpansion();
    ConfigurationManager configurationManager = expansion.getConfigurationManager();
    YamlConfiguration configuration = configurationManager.get("config.yml");
    return !configuration.getBoolean("save-previous");
}
Also used : YamlConfiguration(org.bukkit.configuration.file.YamlConfiguration) ScoreboardExpansion(combatlogx.expansion.scoreboard.ScoreboardExpansion) ConfigurationManager(com.github.sirblobman.api.configuration.ConfigurationManager)

Example 78 with ConfigurationManager

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

the class CombatPlugin method saveDefaultConfig.

@Override
public void saveDefaultConfig(String fileName) {
    ConfigurationManager configurationManager = getConfigurationManager();
    configurationManager.saveDefault(fileName);
}
Also used : ConfigurationManager(com.github.sirblobman.api.configuration.ConfigurationManager)

Example 79 with ConfigurationManager

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

the class CombatPlugin method broadcastDisableMessage.

private void broadcastDisableMessage() {
    ConfigurationManager configurationManager = getConfigurationManager();
    YamlConfiguration configuration = configurationManager.get("config.yml");
    if (!configuration.getBoolean("broadcast.on-disable")) {
        return;
    }
    LanguageManager languageManager = getLanguageManager();
    languageManager.broadcastMessage("broadcast.on-disable", null, true);
}
Also used : LanguageManager(com.github.sirblobman.api.language.LanguageManager) YamlConfiguration(org.bukkit.configuration.file.YamlConfiguration) ConfigurationManager(com.github.sirblobman.api.configuration.ConfigurationManager)

Example 80 with ConfigurationManager

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

the class PunishManager method increasePunishmentCount.

private void increasePunishmentCount(OfflinePlayer player) {
    ConfigurationManager configurationManager = this.plugin.getConfigurationManager();
    YamlConfiguration configuration = configurationManager.get("punish.yml");
    if (!configuration.getBoolean("enable-punishment-counter")) {
        return;
    }
    PlayerDataManager playerDataManager = this.plugin.getPlayerDataManager();
    YamlConfiguration playerData = playerDataManager.get(player);
    long currentCount = playerData.getLong("punishment-count", 0L);
    playerData.set("punishment-count", currentCount + 1L);
    playerDataManager.save(player);
}
Also used : YamlConfiguration(org.bukkit.configuration.file.YamlConfiguration) ConfigurationManager(com.github.sirblobman.api.configuration.ConfigurationManager) PlayerDataManager(com.github.sirblobman.api.configuration.PlayerDataManager)

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