Search in sources :

Example 81 with ConfigurationManager

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

the class PunishManager method runKillCheck.

private void runKillCheck(Player player) {
    ConfigurationManager configurationManager = this.plugin.getConfigurationManager();
    YamlConfiguration configuration = configurationManager.get("punish.yml");
    String killOptionString = configuration.getString("kill-time");
    if (killOptionString == null) {
        killOptionString = "QUIT";
    }
    if (killOptionString.equals("QUIT")) {
        IDeathListener listenerDeath = this.plugin.getDeathListener();
        listenerDeath.add(player);
        player.setHealth(0.0D);
    }
    if (killOptionString.equals("JOIN")) {
        YamlConfiguration playerData = this.plugin.getData(player);
        playerData.set("kill-on-join", true);
        this.plugin.saveData(player);
    }
}
Also used : IDeathListener(com.github.sirblobman.combatlogx.api.listener.IDeathListener) YamlConfiguration(org.bukkit.configuration.file.YamlConfiguration) ConfigurationManager(com.github.sirblobman.api.configuration.ConfigurationManager)

Example 82 with ConfigurationManager

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

the class CombatPlugin method onReload.

@Override
public void onReload() {
    ConfigurationManager configurationManager = getConfigurationManager();
    List<String> fileNameList = Arrays.asList("commands.yml", "config.yml", "punish.yml");
    for (String fileName : fileNameList) {
        configurationManager.reload(fileName);
    }
    LanguageManager languageManager = getLanguageManager();
    languageManager.reloadLanguages();
    IPunishManager punishManager = getPunishManager();
    punishManager.loadPunishments();
    ExpansionManager expansionManager = getExpansionManager();
    expansionManager.reloadConfigs();
}
Also used : IPunishManager(com.github.sirblobman.combatlogx.api.manager.IPunishManager) ExpansionManager(com.github.sirblobman.combatlogx.api.expansion.ExpansionManager) LanguageManager(com.github.sirblobman.api.language.LanguageManager) ConfigurationManager(com.github.sirblobman.api.configuration.ConfigurationManager)

Example 83 with ConfigurationManager

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

the class CombatPlugin method broadcastLoadMessage.

private void broadcastLoadMessage() {
    ConfigurationManager configurationManager = getConfigurationManager();
    YamlConfiguration configuration = configurationManager.get("config.yml");
    if (!configuration.getBoolean("broadcast.on-load")) {
        return;
    }
    LanguageManager languageManager = getLanguageManager();
    languageManager.broadcastMessage("broadcast.on-load", 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 84 with ConfigurationManager

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

the class MobTaggerExpansion method reloadConfig.

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

Example 85 with ConfigurationManager

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

the class ListenerDamage method onFish.

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onFish(PlayerFishEvent e) {
    ConfigurationManager configurationManager = getPluginConfigurationManager();
    YamlConfiguration configuration = configurationManager.get("config.yml");
    if (!configuration.getBoolean("link-fishing-rod")) {
        return;
    }
    State state = e.getState();
    if (state != State.CAUGHT_ENTITY) {
        return;
    }
    Entity caughtEntity = e.getCaught();
    if (caughtEntity == null) {
        return;
    }
    Player player = e.getPlayer();
    checkTag(player, caughtEntity, TagReason.ATTACKER);
}
Also used : Entity(org.bukkit.entity.Entity) LivingEntity(org.bukkit.entity.LivingEntity) Player(org.bukkit.entity.Player) State(org.bukkit.event.player.PlayerFishEvent.State) YamlConfiguration(org.bukkit.configuration.file.YamlConfiguration) ConfigurationManager(com.github.sirblobman.api.configuration.ConfigurationManager) EventHandler(org.bukkit.event.EventHandler)

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