Class GenericRecipeUtils

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

public final class GenericRecipeUtils extends Object
Provides some utility methods to help build more complex GenericRecipes.
  • Method Details

    • calculateRestrictions

      @NotNull public static @NotNull List<net.minecraft.network.chat.Component> calculateRestrictions(@NotNull @NotNull CustomRecipe customRecipe)
    • create

      @NotNull public static @NotNull IGenericRecipe create(@NotNull @NotNull CustomRecipe customRecipe, @NotNull @NotNull IRecipeStorage storage)
    • filterInputs

      @NotNull public static @NotNull IGenericRecipe filterInputs(@NotNull @NotNull IGenericRecipe recipe, @NotNull @NotNull OptionalPredicate<net.minecraft.world.item.ItemStack> predicate)
      Exclude input ingredients that fail the supplied predicate.
      Parameters:
      recipe - the original recipe
      predicate - an ingredient predicate that returns false to reject an ingredient
      Returns:
      the original recipe, if there were no problems. or a modified recipe, if some ingredients were banned but alternates were acceptable. some slots might still contain banned ingredients if there were no valid alternatives.