Search in sources :

Example 6 with ConfigurationManager

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

the class ForceFieldExpansion method reloadConfig.

@Override
public void reloadConfig() {
    ConfigurationManager configurationManager = getConfigurationManager();
    configurationManager.reload("config.yml");
    ListenerForceField listenerForceField = getListenerForceField();
    listenerForceField.unregister();
    listenerForceField.removeProtocol();
    listenerForceField.clearData();
    registerForceFieldListener();
}
Also used : ConfigurationManager(com.github.sirblobman.api.configuration.ConfigurationManager) ListenerForceField(combatlogx.expansion.force.field.listener.ListenerForceField)

Example 7 with ConfigurationManager

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

the class ForceFieldExpansion method onLoad.

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

Example 8 with ConfigurationManager

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

the class TownyRegionHandler method isSafeZone.

@Override
public boolean isSafeZone(Player player, Location location, TagType tagType) {
    if (tagType != TagType.PLAYER) {
        return false;
    }
    RegionExpansion expansion = getExpansion();
    ConfigurationManager configurationManager = expansion.getConfigurationManager();
    YamlConfiguration configuration = configurationManager.get("config.yml");
    TownBlock townBlock = getTownBlock(location);
    if (townBlock == null) {
        return false;
    }
    if (configuration.getBoolean("prevent-all-town-entries", false)) {
        if (isOwnTown(townBlock, player)) {
            return true;
        }
    }
    TownyWorld townyWorld = townBlock.getWorld();
    if (townyWorld == null || townyWorld.isForcePVP()) {
        return false;
    }
    Town town;
    try {
        town = townBlock.getTown();
        if (town == null || town.isPVP() || town.isAdminEnabledPVP() || town.hasActiveWar()) {
            return false;
        }
    } catch (NotRegisteredException ex) {
        return false;
    }
    PluginManager pluginManager = Bukkit.getPluginManager();
    if (pluginManager.isPluginEnabled("FlagWar")) {
        if (FlagWarAPI.isUnderAttack(town)) {
            return false;
        }
    }
    TownyPermission townBlockPermissions = townBlock.getPermissions();
    return !townBlockPermissions.pvp;
}
Also used : PluginManager(org.bukkit.plugin.PluginManager) TownyPermission(com.palmergames.bukkit.towny.object.TownyPermission) RegionExpansion(com.github.sirblobman.combatlogx.api.expansion.region.RegionExpansion) NotRegisteredException(com.palmergames.bukkit.towny.exceptions.NotRegisteredException) Town(com.palmergames.bukkit.towny.object.Town) YamlConfiguration(org.bukkit.configuration.file.YamlConfiguration) TownyWorld(com.palmergames.bukkit.towny.object.TownyWorld) ConfigurationManager(com.github.sirblobman.api.configuration.ConfigurationManager) TownBlock(com.palmergames.bukkit.towny.object.TownBlock)

Example 9 with ConfigurationManager

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

the class LoggerExpansion method reloadConfig.

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

Example 10 with ConfigurationManager

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

the class LoggerExpansion method onLoad.

@Override
public void onLoad() {
    ConfigurationManager configurationManager = getConfigurationManager();
    configurationManager.saveDefault("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