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

View file

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