default values incase someone broke the config (it happens, it just

happens)
This commit is contained in:
Minecon724 2022-01-29 17:46:24 +01:00
parent cf853f7015
commit de8ecdaee9
1 changed files with 7 additions and 7 deletions

View File

@ -52,12 +52,12 @@ public class Main extends JavaPlugin implements Listener {
}
config = YamlConfiguration.loadConfiguration(configFile);
ai = config.getBoolean("ai");
chance = config.getDouble("chance");
attackDamage = config.getDouble("attackDamage");
attackReach = config.getDouble("attackReach");
expandUp = config.getDouble("expandUp");
for (Object s : config.getList("effects")) {
ai = config.getBoolean("ai", true);
chance = config.getDouble("chance", 0.02D);
attackDamage = config.getDouble("attackDamage", 1.0D);
attackReach = config.getDouble("attackReach", 2D);
expandUp = config.getDouble("expandUp", 0D);
for (Object s : config.getList("effects", new ArrayList<Object>)) {
try {
String[] parts = ((String) s).split(":");
if (!(StringUtils.isNumeric(parts[1]))) {
@ -88,7 +88,7 @@ public class Main extends JavaPlugin implements Listener {
}
}
}
}.runTaskTimer(this, config.getLong("hitDelay"), 0L);
}.runTaskTimer(this, config.getLong("hitDelay", 20L), 0L);
if (headRotations) {
new BukkitRunnable() {
@Override