Class RecipeAnalyzer
java.lang.Object
com.minecolonies.core.colony.crafting.RecipeAnalyzer
Utility helpers for analyzing the available recipes and determining which crafters are able to use them.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Map<CraftingType, List<IGenericRecipe>> buildVanillaRecipesMap(@NotNull net.minecraft.world.item.crafting.RecipeManager recipeManager, @NotNull net.minecraft.world.level.Level world) Build a map of all potentially learnable vanilla recipes, converted toIGenericRecipe.static List<net.minecraft.world.entity.animal.Animal> createAnimals(@NotNull net.minecraft.world.level.Level level) Create example instances of every possibleAnimalentity.static List<IGenericRecipe> findRecipes(@NotNull List<net.minecraft.world.entity.animal.Animal> animals, @NotNull AnimalHerdingModule module) Find "recipes" from a particular animal herding module.static @NotNull List<IGenericRecipe> findRecipes(@NotNull Map<CraftingType, List<IGenericRecipe>> vanilla, @NotNull ICraftingBuildingModule crafting, @NotNull net.minecraft.world.level.Level world) Find all recipes for a given crafter.
-
Method Details
-
buildVanillaRecipesMap
public static Map<CraftingType,List<IGenericRecipe>> buildVanillaRecipesMap(@NotNull @NotNull net.minecraft.world.item.crafting.RecipeManager recipeManager, @NotNull @NotNull net.minecraft.world.level.Level world) Build a map of all potentially learnable vanilla recipes, converted toIGenericRecipe.- Parameters:
recipeManager- the vanilla recipe managerworld- the world, if available (some recipes need it)- Returns:
- the recipe map
-
findRecipes
@NotNull public static @NotNull List<IGenericRecipe> findRecipes(@NotNull @NotNull Map<CraftingType, List<IGenericRecipe>> vanilla, @NotNull @NotNull ICraftingBuildingModule crafting, @NotNull @NotNull net.minecraft.world.level.Level world) Find all recipes for a given crafter.- Parameters:
vanilla- vanilla recipes map.crafting- crafting module.- Returns:
- list of recipes
-
createAnimals
public static List<net.minecraft.world.entity.animal.Animal> createAnimals(@NotNull @NotNull net.minecraft.world.level.Level level) Create example instances of every possibleAnimalentity.- Parameters:
level- a level- Returns:
- list of animals
-
findRecipes
public static List<IGenericRecipe> findRecipes(@NotNull @NotNull List<net.minecraft.world.entity.animal.Animal> animals, @NotNull @NotNull AnimalHerdingModule module) Find "recipes" from a particular animal herding module.- Parameters:
animals- all possible animals (fromcreateAnimals(net.minecraft.world.level.Level))module- the herding module- Returns:
- recipes for that module
-