From 3cff8aba16a5490844832c40de753b77cb791c5f Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Tue, 5 Feb 2013 00:43:06 +0100 Subject: [PATCH] Add an error message when the config.yml is outdated. Adressess #626. --- src/main/java/com/gmail/nossr50/config/Config.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/gmail/nossr50/config/Config.java b/src/main/java/com/gmail/nossr50/config/Config.java index afc56f4f1..25ab5dbd4 100644 --- a/src/main/java/com/gmail/nossr50/config/Config.java +++ b/src/main/java/com/gmail/nossr50/config/Config.java @@ -4,6 +4,8 @@ import java.util.Set; import org.bukkit.configuration.ConfigurationSection; +import com.gmail.nossr50.mcMMO; + public class Config extends ConfigLoader { private static Config instance; @@ -394,6 +396,12 @@ public class Config extends ConfigLoader { private boolean doubleDropsDisabled(String skillName) { ConfigurationSection section = config.getConfigurationSection("Double_Drops." + skillName); + + if (section == null) { + mcMMO.p.getLogger().warning("The configuration files are outdated!"); //TODO Locale and more descriptive message! + return false; + } + Set keys = section.getKeys(false); boolean disabled = true;