Add RecipeCatalyst system (#195)

* Add RecipeCatalyst system
This commit is contained in:
miozune authored and GitHub committed 2022-01-21 20:16:28 -08:00
1 parent 3ce702343d
commit 1e36822fa4
19 files changed
+490 -9

No files matched your search

@@ -28,11 +28,18 @@ public class GuiUsageRecipe extends GuiRecipe
handlers = serialUsageHandlers.stream().map(h -> h.getUsageHandler(inputId, ingredients))
.filter(h -> h.numRecipes() > 0)
.collect(Collectors.toCollection(ArrayList::new));
handlers.addAll(ItemList.forkJoinPool.submit(() -> usagehandlers.parallelStream()
.map(h -> h.getUsageHandler(inputId, ingredients))
.filter(h -> h.numRecipes() > 0)
.collect(Collectors.toCollection(ArrayList::new))).get());
if (NEIClientConfig.areJEIStyleRecipeCatalystsVisible()) {
handlers.addAll(ItemList.forkJoinPool.submit(() -> usagehandlers.parallelStream()
.map(h -> h.getUsageAndCatalystHandler(inputId, ingredients))
.filter(h -> h.numRecipes() > 0)
.collect(Collectors.toCollection(ArrayList::new))).get());
} else {
handlers.addAll(ItemList.forkJoinPool.submit(() -> usagehandlers.parallelStream()
.map(h -> h.getUsageHandler(inputId, ingredients))
.filter(h -> h.numRecipes() > 0)
.collect(Collectors.toCollection(ArrayList::new))).get());
}
} catch (InterruptedException | ExecutionException e) {
e.printStackTrace();
return false;