diff --git a/common/implementation/bootstrap-addon-loader/src/main/java/com/dfsek/terra/addon/BootstrapAddonLoader.java b/common/implementation/bootstrap-addon-loader/src/main/java/com/dfsek/terra/addon/BootstrapAddonLoader.java index f3b56cde7..e6027fe88 100644 --- a/common/implementation/bootstrap-addon-loader/src/main/java/com/dfsek/terra/addon/BootstrapAddonLoader.java +++ b/common/implementation/bootstrap-addon-loader/src/main/java/com/dfsek/terra/addon/BootstrapAddonLoader.java @@ -80,15 +80,18 @@ public class BootstrapAddonLoader implements BootstrapBaseAddon> loadAddons(Path addonsFolder, BootstrapAddonClassLoader parent) { - Path bootstrapFolder = addonsFolder.resolve("bootstrap"); - logger.debug("Loading bootstrap addons from {}", bootstrapFolder); - - try(Stream bootstrapAddons = Files.walk(bootstrapFolder, 1, FileVisitOption.FOLLOW_LINKS)) { - return bootstrapAddons.filter(path -> path.toFile().isFile()) - .filter(path -> path.toFile().canRead()) - .filter(path -> path.toString().endsWith(".jar")) - .map(path -> loadAddon(path, parent)) - .collect(Collectors.toList()); + try { + Path bootstrapFolder = addonsFolder.resolve("bootstrap"); + Files.createDirectories(bootstrapFolder); + logger.debug("Loading bootstrap addons from {}", bootstrapFolder); + + try(Stream bootstrapAddons = Files.walk(bootstrapFolder, 1, FileVisitOption.FOLLOW_LINKS)) { + return bootstrapAddons.filter(path -> path.toFile().isFile()) + .filter(path -> path.toFile().canRead()) + .filter(path -> path.toString().endsWith(".jar")) + .map(path -> loadAddon(path, parent)) + .collect(Collectors.toList()); + } } catch(IOException e) { throw new UncheckedIOException(e); }