Class RecipeAnalyzer

java.lang.Object
com.minecolonies.core.colony.crafting.RecipeAnalyzer

public final class RecipeAnalyzer extends Object
Utility helpers for analyzing the available recipes and determining which crafters are able to use them.
  • 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 to IGenericRecipe.
      Parameters:
      recipeManager - the vanilla recipe manager
      world - 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 possible Animal entity.
      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 (from createAnimals(net.minecraft.world.level.Level))
      module - the herding module
      Returns:
      recipes for that module