Added NoSlowdown, migrations to new config

This commit is contained in:
Rammelkast committed 2020-07-12 14:04:18 +02:00
1 parent add3fe5eae
commit 2086a01f80
20 files changed
+288 -243

No files matched your search

@@ -49,7 +49,6 @@ public class Config extends ConfigurationFile {
public ConfigValue<Boolean> logToFile;
public ConfigValue<List<String>> disabledWorlds;
public ConfigValue<List<String>> disabledChecks;
public ConfigValue<Integer> notifyEveryVl;
@@ -81,7 +80,6 @@ public class Config extends ConfigurationFile {
logToFile = new ConfigValue<Boolean>("system.log-to-file");
disabledWorlds = new ConfigValue<List<String>>("disable-in");
disabledChecks = new ConfigValue<List<String>>("disabled-checks");
notifyEveryVl = new ConfigValue<Integer>("system.notify-every-vl");
if (notifyEveryVl.getValue() < 1) {
@@ -18,6 +18,9 @@
*/
package com.rammelkast.anticheatreloaded.config.holders.yaml;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
import com.rammelkast.anticheatreloaded.check.CheckType;
import com.rammelkast.anticheatreloaded.config.Configuration;
@@ -78,8 +81,13 @@ public class YamlChecksHolder extends ConfigurationFile implements Checks {
@Override
public boolean isEnabled(CheckType checkType) {
// If the root of a check has no enabled or disabled option, it has to be configured on a subcheck basis
if (!this.getConfigFile().getConfigurationSection(checkType.name().toLowerCase()).contains("enabled"))
if (!this.getConfigFile().isConfigurationSection(checkType.getName().toLowerCase())) {
Bukkit.getConsoleSender().sendMessage(ChatColor.GOLD + "" + ChatColor.BOLD + "ACR " + ChatColor.RED
+ "Missing configuration settings for " + checkType.getName() + "!");
return true;
return this.getConfigFile().getConfigurationSection(checkType.name().toLowerCase()).getBoolean("enabled");
}
if (!this.getConfigFile().getConfigurationSection(checkType.getName().toLowerCase()).contains("enabled"))
return true;
return this.getConfigFile().getConfigurationSection(checkType.getName().toLowerCase()).getBoolean("enabled");
}
}