From f877073ae0d938e93ccee527fb9193bda53cc005 Mon Sep 17 00:00:00 2001 From: Francesco Macagno Date: Mon, 24 Aug 2015 22:06:28 -0700 Subject: [PATCH] Add empty mod string check --- .../warpdrive/config/ModRequirementChecker.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/cr0s/warpdrive/config/ModRequirementChecker.java b/src/main/java/cr0s/warpdrive/config/ModRequirementChecker.java index 8ec469c0..cc3b4767 100644 --- a/src/main/java/cr0s/warpdrive/config/ModRequirementChecker.java +++ b/src/main/java/cr0s/warpdrive/config/ModRequirementChecker.java @@ -9,7 +9,7 @@ import cr0s.warpdrive.WarpDrive; public class ModRequirementChecker { - + /** * Will check the given element for a mod attribute and return a string of all the ones that are not loaded, separated by commas * @@ -19,13 +19,17 @@ public class ModRequirementChecker { * @throws InvalidXmlException */ public static String checkModRequirements(Element e) { - + String missingMods = ""; - + for (String mod : e.getAttribute("mods").split(",")) { - + //TODO: add version check + + if (mod.isEmpty()) + continue; + if (!Loader.isModLoaded(mod)) { missingMods = missingMods + mod + ", "; } @@ -60,10 +64,10 @@ public class ModRequirementChecker { doModReqSanitation(child); } - + } } } - + }