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);
}
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") + ".");
}
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");
}
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");
}
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");
}
Aggregations