Class GenericRecipeUtils
java.lang.Object
com.minecolonies.core.colony.crafting.GenericRecipeUtils
Provides some utility methods to help build more complex
GenericRecipes.-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull List<net.minecraft.network.chat.Component>calculateRestrictions(@NotNull CustomRecipe customRecipe) static @NotNull IGenericRecipecreate(@NotNull CustomRecipe customRecipe, @NotNull IRecipeStorage storage) static @NotNull IGenericRecipefilterInputs(@NotNull IGenericRecipe recipe, @NotNull OptionalPredicate<net.minecraft.world.item.ItemStack> predicate) Exclude input ingredients that fail the supplied predicate.
-
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 recipepredicate- 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.
-