Add empty mod string check
This commit is contained in:
parent
c19c2bc696
commit
f877073ae0
1 changed files with 10 additions and 6 deletions
|
@ -9,7 +9,7 @@ import cr0s.warpdrive.WarpDrive;
|
||||||
|
|
||||||
|
|
||||||
public class ModRequirementChecker {
|
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
|
* 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
|
* @throws InvalidXmlException
|
||||||
*/
|
*/
|
||||||
public static String checkModRequirements(Element e) {
|
public static String checkModRequirements(Element e) {
|
||||||
|
|
||||||
String missingMods = "";
|
String missingMods = "";
|
||||||
|
|
||||||
for (String mod : e.getAttribute("mods").split(",")) {
|
for (String mod : e.getAttribute("mods").split(",")) {
|
||||||
|
|
||||||
//TODO: add version check
|
//TODO: add version check
|
||||||
|
|
||||||
|
|
||||||
|
if (mod.isEmpty())
|
||||||
|
continue;
|
||||||
|
|
||||||
if (!Loader.isModLoaded(mod)) {
|
if (!Loader.isModLoaded(mod)) {
|
||||||
missingMods = missingMods + mod + ", ";
|
missingMods = missingMods + mod + ", ";
|
||||||
}
|
}
|
||||||
|
@ -60,10 +64,10 @@ public class ModRequirementChecker {
|
||||||
doModReqSanitation(child);
|
doModReqSanitation(child);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue