use of com.github.sirblobman.api.configuration.ConfigurationManager in project CombatLogX by SirBlobman.
the class PVPManager method isDisabled.
public boolean isDisabled(Player player) {
Validate.notNull(player, "player must not be null!");
if (player.hasMetadata("NPC")) {
return false;
}
ConfigurationManager configurationManager = this.expansion.getConfigurationManager();
YamlConfiguration configuration = configurationManager.get("config.yml");
boolean defaultPvpState = configuration.getBoolean("pvp-toggle-default-status", true);
ICombatLogX plugin = this.expansion.getPlugin();
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
YamlConfiguration playerData = playerDataManager.get(player);
return !playerData.getBoolean("newbie-helper.pvp-toggle", defaultPvpState);
}
use of com.github.sirblobman.api.configuration.ConfigurationManager in project CombatLogX by SirBlobman.
the class ListenerLogger method isDisabled.
private boolean isDisabled(String path) {
Expansion expansion = getExpansion();
ConfigurationManager configurationManager = expansion.getConfigurationManager();
YamlConfiguration configuration = configurationManager.get("config.yml");
return !configuration.getBoolean("log-options." + path);
}
use of com.github.sirblobman.api.configuration.ConfigurationManager in project CombatLogX by SirBlobman.
the class ListenerLogger method getLogFileName.
private String getLogFileName() {
Expansion expansion = getExpansion();
ConfigurationManager configurationManager = expansion.getConfigurationManager();
YamlConfiguration configuration = configurationManager.get("config.yml");
String fileNameOption = configuration.getString("log-file-info.file-name");
if (fileNameOption == null)
fileNameOption = "logger";
String fileExtraFormatOption = configuration.getString("log-file-info.file-extra.format");
if (fileExtraFormatOption == null)
fileExtraFormatOption = "yyyy.MM.dd";
String fileExtensionOption = configuration.getString("log-file-info.file-extension");
if (fileExtensionOption == null)
fileExtensionOption = "log";
SimpleDateFormat format = new SimpleDateFormat(fileExtraFormatOption);
Date currentDate = new Date(System.currentTimeMillis());
String fileNameExtra = format.format(currentDate);
String preFileName = (fileNameOption + "-" + fileNameExtra + "." + fileExtensionOption);
Matcher matcher = this.fileNameRegex.matcher(preFileName);
return matcher.replaceAll("_");
}
use of com.github.sirblobman.api.configuration.ConfigurationManager in project CombatLogX by SirBlobman.
the class VanishNoPacketExpansion 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 VanishNoPacketExpansion method reloadConfig.
@Override
public void reloadConfig() {
ConfigurationManager configurationManager = getConfigurationManager();
configurationManager.reload("config.yml");
}
Aggregations