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