Class RecipeFinder
java.lang.Object
com.simibubi.create.foundation.recipe.RecipeFinder
Utility for searching through a level's recipe collection.
Non-dynamic conditions can be split off into an initial search for caching intermediate results.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.minecraft.server.packs.resources.ResourceManagerReloadListener -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<net.minecraft.world.item.crafting.RecipeHolder<? extends net.minecraft.world.item.crafting.Recipe<?>>> get(Object cacheKey, net.minecraft.world.level.Level level, Predicate<net.minecraft.world.item.crafting.RecipeHolder<? extends net.minecraft.world.item.crafting.Recipe<?>>> conditions) Find all recipes matching the condition predicate.
-
Field Details
-
LISTENER
public static final net.minecraft.server.packs.resources.ResourceManagerReloadListener LISTENER
-
-
Constructor Details
-
RecipeFinder
public RecipeFinder()
-
-
Method Details
-
get
public static List<net.minecraft.world.item.crafting.RecipeHolder<? extends net.minecraft.world.item.crafting.Recipe<?>>> get(@Nullable Object cacheKey, net.minecraft.world.level.Level level, Predicate<net.minecraft.world.item.crafting.RecipeHolder<? extends net.minecraft.world.item.crafting.Recipe<?>>> conditions) Find all recipes matching the condition predicate. If this search is made more than once, using the same object instance as the cacheKey will retrieve the cached result from the first search.- Parameters:
cacheKey- (can be null to prevent the caching)- Returns:
- A started search to continue with more specific conditions.
-