summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinenash <minenash@protonmail.com>2018-12-28 15:33:20 -0500
committerMinenash <minenash@protonmail.com>2018-12-28 15:33:20 -0500
commit47e0796eff750e30a75ee0045988a1665ed2e87e (patch)
tree9d6f73e5fdc8178d01ffd891f0cb389e6668fc12
parent57998e85502d116df2d9a780a7303947ecca85cc (diff)
Now only looks for the info file if the module has a major version of 5
-rw-r--r--src/main/java/com/redstoner/coremods/moduleLoader/ModuleLoader.java22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/main/java/com/redstoner/coremods/moduleLoader/ModuleLoader.java b/src/main/java/com/redstoner/coremods/moduleLoader/ModuleLoader.java
index 4281d58..8b3ca6f 100644
--- a/src/main/java/com/redstoner/coremods/moduleLoader/ModuleLoader.java
+++ b/src/main/java/com/redstoner/coremods/moduleLoader/ModuleLoader.java
@@ -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);