use of mekanism.common.recipe.lookup.cache.type.ChemicalInputCache in project Mekanism by mekanism.
the class ChemicalCrystallizerInputRecipeCache method findFirstRecipe.
@Nullable
private <CHEMICAL extends Chemical<CHEMICAL>, STACK extends ChemicalStack<CHEMICAL>> ChemicalCrystallizerRecipe findFirstRecipe(ChemicalType type, STACK stack) {
Predicate<ChemicalCrystallizerRecipe> matchPredicate = recipe -> ((IChemicalStackIngredient<CHEMICAL, STACK>) recipe.getInput()).test(stack);
ChemicalInputCache<CHEMICAL, STACK, ChemicalCrystallizerRecipe> cache = (ChemicalInputCache<CHEMICAL, STACK, ChemicalCrystallizerRecipe>) typeBasedCache.get(type);
ChemicalCrystallizerRecipe recipe = cache.findFirstRecipe(stack, matchPredicate);
return recipe == null ? findFirstRecipe(typeBasedComplexRecipes.get(type), matchPredicate) : recipe;
}
Aggregations