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 try
{ {
InputStream infoFile = null;
if (VersionHelper.isCompatible(VersionHelper.create(5, 0, 0, 5), module.getClass())) {
String basePath = "plugins/ModuleLoader/classes/" + module.getClass().getName().replace(".", "/"); String basePath = "plugins/ModuleLoader/classes/" + module.getClass().getName().replace(".", "/");
InputStream file;
try { try {
file = new FileInputStream( infoFile = new FileInputStream(
new File(basePath.substring(0, basePath.lastIndexOf('/')+1) + "module.info")); new File(basePath.substring(0, basePath.lastIndexOf('/')+1) + "module.info"));
} }
catch(Exception e) { catch(Exception e) {
file = null; infoFile = null;
} }
}
ModuleInfo info = new ModuleInfo(file, module); ModuleInfo info = new ModuleInfo(infoFile, module);
moduleInfos.put(module, info); moduleInfos.put(module, info);