From de8ecdaee94ffad54e54f6ef5e53389a1544c6f7 Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Sat, 29 Jan 2022 17:46:24 +0100 Subject: [PATCH] default values incase someone broke the config (it happens, it just happens) --- src/main/java/pl/minecon724/giants/Main.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/pl/minecon724/giants/Main.java b/src/main/java/pl/minecon724/giants/Main.java index 87b20d4..b4b2fbc 100644 --- a/src/main/java/pl/minecon724/giants/Main.java +++ b/src/main/java/pl/minecon724/giants/Main.java @@ -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)) { 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