Skip to content

Commit

Permalink
improved logging when scanning for mods
Browse files Browse the repository at this point in the history
  • Loading branch information
Zomis committed Jun 21, 2015
1 parent 468e0ec commit e1f89ee
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,16 @@ public ModCollection() {
*/
public void loadExternal(Path directory) {
if (!Files.isDirectory(directory)) {
logger.warn(directory + " not found. No external mods loaded");
logger.warn(directory.toAbsolutePath() + " not found. External mod directory not loaded");
return;
}
logger.info("Loading mods in " + directory.toAbsolutePath());
File[] groovyMods = directory.toFile().listFiles();
if (groovyMods != null) {
Arrays.stream(groovyMods)
.filter(File::isDirectory)
.filter(f -> new File(f, "Game.groovy").exists())
.peek(f -> logger.info("Loading mod " + f.getAbsolutePath()))
.forEach(f -> mods.put(f.getName(), () -> new GroovyMod(f, f.getName())));
}
}
Expand Down

0 comments on commit e1f89ee

Please sign in to comment.