File tree Expand file tree Collapse file tree
common/implementation/base/src/main/java/com/dfsek/terra/registry/master Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323import java .nio .file .Path ;
2424import java .util .ArrayList ;
2525import java .util .List ;
26+ import java .util .concurrent .CopyOnWriteArrayList ;
2627import java .util .stream .Stream ;
2728
2829import com .dfsek .terra .api .Platform ;
@@ -44,9 +45,9 @@ public ConfigRegistry() {
4445 public synchronized void loadAll (Platform platform ) throws IOException , PackLoadFailuresException {
4546 Path packsDirectory = platform .getDataFolder ().toPath ().resolve ("packs" );
4647 Files .createDirectories (packsDirectory );
47- List <Exception > failedLoads = new ArrayList <>();
48+ List <Exception > failedLoads = new CopyOnWriteArrayList <>();
4849 try (Stream <Path > packs = Files .list (packsDirectory )) {
49- packs .forEach (path -> {
50+ packs .parallel (). forEach (path -> {
5051 try {
5152 ConfigPack pack = new ConfigPackImpl (path , platform );
5253 registerChecked (pack .getRegistryKey (), pack );
You can’t perform that action at this time.
0 commit comments