Change Search Recipe Algorithm

This commit is contained in:
slprime committed 2024-01-26 17:53:31 +02:00
1 parent 183e40a6c2
commit 9873de760f
8 files changed
+318 -334

No files matched your search

@@ -34,7 +34,6 @@ class RecipeHandlerQuery<T extends IRecipeHandler> {
ArrayList<T> runWithProfiling(String profilerSection) {
TaskProfiler profiler = ProfilerRecipeHandler.getProfiler();
TemplateRecipeHandler.disableCycledIngredients = true;
profiler.start(profilerSection);
try {
ArrayList<T> handlers = getRecipeHandlersParallel();
@@ -48,7 +47,6 @@ class RecipeHandlerQuery<T extends IRecipeHandler> {
displayRecipeLookupError();
return new ArrayList<>(0);
} finally {
TemplateRecipeHandler.disableCycledIngredients = false;
profiler.end();
}
}
@@ -72,7 +70,8 @@ class RecipeHandlerQuery<T extends IRecipeHandler> {
error = true;
return null;
}
}).filter(h -> h != null && !h.isEmpty()).collect(Collectors.toCollection(ArrayList::new));
}).filter(h -> h != null && h.numRecipes() > 0 && SearchRecipeHandler.findFirst(h, (recipeIndex) -> true) != -1)
.collect(Collectors.toCollection(ArrayList::new));
}
private ArrayList<T> getHandlersWithRecipes() throws InterruptedException, ExecutionException {
@@ -85,7 +84,8 @@ class RecipeHandlerQuery<T extends IRecipeHandler> {
error = true;
return null;
}
}).filter(h -> h != null && !h.isEmpty()).collect(Collectors.toCollection(ArrayList::new))).get();
}).filter(h -> h != null && h.numRecipes() > 0 && SearchRecipeHandler.findFirst(h, (recipeIndex) -> true) != -1)
.collect(Collectors.toCollection(ArrayList::new))).get();
}
private boolean isHidden(T handler) {