use of com.github.sirblobman.api.configuration.ConfigurationManager in project CombatLogX by SirBlobman.
the class ListenerConfiguration method checkBypass.
private boolean checkBypass(Player player) {
ConfigurationManager configurationManager = getPluginConfigurationManager();
YamlConfiguration configuration = configurationManager.get("config.yml");
String bypassPermissionName = configuration.getString("bypass-permission");
if (bypassPermissionName == null || bypassPermissionName.isEmpty())
return false;
Permission bypassPermission = new Permission(bypassPermissionName, "CombatLogX Bypass Permission", PermissionDefault.FALSE);
return player.hasPermission(bypassPermission);
}
use of com.github.sirblobman.api.configuration.ConfigurationManager in project CombatLogX by SirBlobman.
the class ListenerConfiguration method checkDisabledWorld.
private boolean checkDisabledWorld(Player player) {
ConfigurationManager configurationManager = getPluginConfigurationManager();
YamlConfiguration configuration = configurationManager.get("config.yml");
List<String> disabledWorldList = configuration.getStringList("disabled-world-list");
boolean inverted = configuration.getBoolean("disabled-world-list-inverted");
World world = player.getWorld();
String worldName = world.getName();
boolean contains = disabledWorldList.contains(worldName);
return (inverted != contains);
}
use of com.github.sirblobman.api.configuration.ConfigurationManager in project CombatLogX by SirBlobman.
the class ListenerConfiguration method checkEnemyDeathUntag.
private void checkEnemyDeathUntag(LivingEntity enemy) {
ConfigurationManager configurationManager = getPluginConfigurationManager();
YamlConfiguration configuration = configurationManager.get("config.yml");
if (!configuration.getBoolean("untag-on-enemy-death"))
return;
ICombatManager combatManager = getCombatManager();
OfflinePlayer offlinePlayer = combatManager.getByEnemy(enemy);
if (offlinePlayer == null || !offlinePlayer.isOnline())
return;
Player player = offlinePlayer.getPlayer();
if (player != null && combatManager.isInCombat(player))
combatManager.untag(player, UntagReason.ENEMY_DEATH);
}
use of com.github.sirblobman.api.configuration.ConfigurationManager in project CombatLogX by SirBlobman.
the class CombatPlugin method onLoad.
@Override
public void onLoad() {
ConfigurationChecker configurationChecker = new ConfigurationChecker(this);
configurationChecker.checkVersion();
ConfigurationManager configurationManager = getConfigurationManager();
configurationManager.saveDefault("config.yml");
configurationManager.saveDefault("commands.yml");
configurationManager.saveDefault("punish.yml");
LanguageManager languageManager = getLanguageManager();
languageManager.saveDefaultLanguages();
languageManager.reloadLanguages();
ExpansionManager expansionManager = getExpansionManager();
expansionManager.loadExpansions();
broadcastLoadMessage();
}
use of com.github.sirblobman.api.configuration.ConfigurationManager in project CombatLogX by SirBlobman.
the class RewardExpansion method useMVdWPlaceholderAPI.
public boolean useMVdWPlaceholderAPI() {
ConfigurationManager configurationManager = getConfigurationManager();
YamlConfiguration configuration = configurationManager.get("config.yml");
boolean useMVdWPlaceholderAPI = configuration.getBoolean("hooks.mvdwplaceholderapi");
if (useMVdWPlaceholderAPI) {
PluginManager pluginManager = Bukkit.getPluginManager();
return pluginManager.isPluginEnabled("MVdWPlaceholderAPI");
}
return false;
}
Aggregations