Add recipe text search with ~ prefix (#1120)

This commit is contained in:
slprime authored and GitHub committed 2026-11-15 15:43:35 +02:00
1 parent 8e6b31de18
commit 1c33a5b7d6
16 files changed
+363 -71

No files matched your search

@@ -121,6 +121,26 @@ public interface IRecipeHandler {
return getResultStack(recipe) != null ? getOtherStacks(recipe) : Collections.emptyList();
}
/**
* Override it to let the recipe search see stacks that the recipe doesn't draw and doesn't give to the overlay.
*
* @return The stacks of the role the recipe search looks at; called from the search threads.
*/
default List<PositionedStack> getSearchStacks(int recipe, RecipeRole role) {
return switch (role) {
case INPUT -> getIngredientStacks(recipe);
case OUTPUT -> getResultStacks(recipe);
case AUXILIARY -> getAuxiliaryStacks(recipe);
};
}
/**
* @return The text the recipe text search looks at, none by default; called from the search threads.
*/
default List<String> getSearchText(int recipe) {
return Collections.emptyList();
}
/**
* @param recipe The recipe index to get the group id for.
* @return An id shared by every recipe in this recipe's group, or {@code null} if this recipe isn't grouped.