Search in sources :

Example 11 with ConfigurationManager

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

the class ListenerLogger method getLoggerFormat.

private String getLoggerFormat(String path) {
    Expansion expansion = getExpansion();
    ConfigurationManager configurationManager = expansion.getConfigurationManager();
    YamlConfiguration configuration = configurationManager.get("config.yml");
    String prefixFormat = configuration.getString("log-entry-options.prefix-format");
    if (prefixFormat == null)
        prefixFormat = "[MMMM dd, YYYY HH:mm:ss.SSSa zzz] ";
    SimpleDateFormat format = new SimpleDateFormat(prefixFormat);
    String prefix = format.format(new Date(System.currentTimeMillis()));
    String messageFormat = configuration.getString("log-entry-options." + path);
    if (messageFormat == null)
        messageFormat = "";
    return (prefix + messageFormat);
}
Also used : YamlConfiguration(org.bukkit.configuration.file.YamlConfiguration) Expansion(com.github.sirblobman.combatlogx.api.expansion.Expansion) LoggerExpansion(combatlogx.expansion.logger.LoggerExpansion) ConfigurationManager(com.github.sirblobman.api.configuration.ConfigurationManager) SimpleDateFormat(java.text.SimpleDateFormat) Date(java.util.Date)

Example 12 with ConfigurationManager

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

the class LootProtectionExpansion method reloadConfig.

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

Example 13 with ConfigurationManager

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

the class LootProtectionExpansion method onLoad.

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

Example 14 with ConfigurationManager

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

the class DamageTaggerExpansion method onLoad.

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

Example 15 with ConfigurationManager

use of com.github.sirblobman.api.configuration.ConfigurationManager 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)

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