Create Bookmarks Groups; Search Recipe (#451)

* Create Bookmarks Groups; Search Recipe

* fix crash after DnD; add remove group function

* change hiddenhandler handlerId

* Pull all Bookmarked Items: use groups

* Optimize Chain Algorithm

* remove println

* fix input V in ME terminal

* Add Search Recipe Icon

* fix recipe extra information

* Change Search Recipe Algorithm

* fixed rounding in chain calculation

* fix creating groups for 2-line recipes

* fix fast DnD and recipe tooltip

* Bookmarks Recipe Chains: fluid canner

* Bookmarks Recipe Chains: fluid cell

* Open GuiRecipe: normalizeItemStack

---------

Co-authored-by: slprime <[email protected]>
This commit is contained in:
slprimeandslprime authored and GitHub committed 2024-02-04 13:09:24 +01:00
1 parent e30f6a41ad
commit adf2065305
38 files changed
+3135 -892

No files matched your search

@@ -37,6 +37,7 @@ class RecipeHandlerQuery<T extends IRecipeHandler> {
profiler.start(profilerSection);
try {
ArrayList<T> handlers = getRecipeHandlersParallel();
if (error) {
displayRecipeLookupError();
}
@@ -60,27 +61,37 @@ class RecipeHandlerQuery<T extends IRecipeHandler> {
}
private ArrayList<T> getSerialHandlersWithRecipes() {
return serialRecipeHandlers.stream().map(handler -> {
try {
return recipeHandlerFunction.apply(handler);
return isHidden(handler) ? null : recipeHandlerFunction.apply(handler);
} catch (Throwable t) {
printLog(t);
error = true;
return null;
}
}).filter(h -> h != null && h.numRecipes() > 0).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 {
return ItemList.forkJoinPool.submit(() -> recipeHandlers.parallelStream().map(handler -> {
try {
return recipeHandlerFunction.apply(handler);
return isHidden(handler) ? null : recipeHandlerFunction.apply(handler);
} catch (Throwable t) {
printLog(t);
error = true;
return null;
}
}).filter(h -> h != null && h.numRecipes() > 0).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) {
final String handlerName = handler.getHandlerId();
final String handlerId = handler.getOverlayIdentifier();
return NEIClientConfig.hiddenHandlers.stream().anyMatch(h -> h.equals(handlerId) || h.equals(handlerName));
}
private void printLog(Throwable t) {