Class Search.SearchResult
-
- All Implemented Interfaces:
public final class Search.SearchResultA result of Search.search.
-
-
Field Summary
Fields Modifier and Type Field Description public final static Search.SearchResultEMPTY
-
Method Summary
Modifier and Type Method Description final Recipevanilla()Returns a nullable vanilla recipe. final List<Pair<CRecipe, MappedRelation>>customs()Returns found custom recipes with their coordinate relations. final Integersize()returns search result size that is sum of vanilla and customs. final List<Pair<CRecipe, MappedRelation>>getMergedResults()returns all CRecipe and relation list. final List<Pair<CRecipe, MappedRelation>>getMergedResults(CraftView view)Returns all recipes and their relations, with vanilla recipes resolved against view. -
-
Method Detail
-
vanilla
final Recipe vanilla()
Returns a nullable vanilla recipe.
vanilla is null in the following situations:
vanillaSearchMode is SearchQuery.VanillaSearchMode.IF_CUSTOMS_NOT_FOUND and customs is not empty.
The input does not match any registered vanilla recipe.
-
customs
final List<Pair<CRecipe, MappedRelation>> customs()
Returns found custom recipes with their coordinate relations.
- Returns:
List List of pairs of matched CRecipe and its MappedRelation
-
size
final Integer size()
returns search result size that is sum of vanilla and customs.
examples
vanilla = null, customs.size = 3 -> 0 + 3 = 3 vanilla != null, customs.size = 0 -> 1 + 0 = 1 vanilla != null, customs.size = 1 -> 1 + 1 = 2- Returns:
Int size of result
- Since:
5.0.8
-
getMergedResults
final List<Pair<CRecipe, MappedRelation>> getMergedResults()
returns all CRecipe and relation list. (If 'vanilla' is not null, a result list contains converted CRecipe.)
(If an element converted from a vanilla recipe, it does not contain 'MappedRelation'.)
- Returns:
List = List<Pair<CRecipe, MappedRelation?>>: Result
- Since:
5.0.11
-
getMergedResults
final List<Pair<CRecipe, MappedRelation>> getMergedResults(CraftView view)
Returns all recipes and their relations, with vanilla recipes resolved against view.
Unlike getMergedResults, this overload always includes the vanilla recipe with a concrete MappedRelation.
- Parameters:
view- The crafting view used to compute the vanilla recipe's relation- Returns:
List List of pairs of CRecipe and MappedRelation
- Since:
5.0.11
-
-
-
-