This commit is contained in:
Anuken
2020-09-16 11:44:39 -04:00
parent bc2d4267ee
commit 9cfd78ee1f
8 changed files with 41 additions and 35 deletions

View File

@@ -600,9 +600,14 @@ public class Mods implements Loadable{
zip = zip.list()[0];
}
Fi metaf = zip.child("mod.json").exists() ? zip.child("mod.json") : zip.child("mod.hjson").exists() ? zip.child("mod.hjson") : zip.child("plugin.json");
Fi metaf =
zip.child("mod.json").exists() ? zip.child("mod.json") :
zip.child("mod.hjson").exists() ? zip.child("mod.hjson") :
zip.child("plugin.json").exists() ? zip.child("plugin.json") :
zip.child("plugin.hjson");
if(!metaf.exists()){
Log.warn("Mod @ doesn't have a 'mod.json'/'mod.hjson'/'plugin.json' file, skipping.", sourceFile);
Log.warn("Mod @ doesn't have a '[mod/plugin].[h]json' file, skipping.", sourceFile);
throw new IllegalArgumentException("Invalid file: No mod.json found.");
}
@@ -646,7 +651,9 @@ public class Mods implements Loadable{
meta.hidden = true;
}
Log.info("Loaded mod '@' in @", meta.name, Time.elapsed());
if(!headless){
Log.info("Loaded mod '@' in @ms", meta.name, Time.elapsed());
}
return new LoadedMod(sourceFile, zip, mainMod, meta);
}catch(Exception e){