0

Now only looks for the info file if the module has a major version of 5

This commit is contained in:
Minenash
2018-12-28 15:33:20 -05:00
parent 57998e8550
commit 47e0796eff

View File

@@ -240,18 +240,20 @@ public final class ModuleLoader implements CoreModule
{
try
{
String basePath = "plugins/ModuleLoader/classes/" + module.getClass().getName().replace(".", "/");
InputStream infoFile = null;
InputStream file;
try {
file = new FileInputStream(
new File(basePath.substring(0, basePath.lastIndexOf('/')+1) + "module.info"));
}
catch(Exception e) {
file = null;
}
if (VersionHelper.isCompatible(VersionHelper.create(5, 0, 0, 5), module.getClass())) {
String basePath = "plugins/ModuleLoader/classes/" + module.getClass().getName().replace(".", "/");
ModuleInfo info = new ModuleInfo(file, module);
try {
infoFile = new FileInputStream(
new File(basePath.substring(0, basePath.lastIndexOf('/')+1) + "module.info"));
}
catch(Exception e) {
infoFile = null;
}
}
ModuleInfo info = new ModuleInfo(infoFile, module);
moduleInfos.put(module, info);