package net.minecraft.world.item.crafting; import java.util.Optional; import net.minecraft.world.level.Level; public interface SmithingRecipe extends Recipe { @Override default RecipeType getType() { return RecipeType.SMITHING; } @Override RecipeSerializer getSerializer(); default boolean matches(SmithingRecipeInput smithingRecipeInput, Level level) { return Ingredient.testOptionalIngredient(this.templateIngredient(), smithingRecipeInput.template()) && this.baseIngredient().test(smithingRecipeInput.base()) && Ingredient.testOptionalIngredient(this.additionIngredient(), smithingRecipeInput.addition()); } Optional templateIngredient(); Ingredient baseIngredient(); Optional additionIngredient(); @Override default RecipeBookCategory recipeBookCategory() { return RecipeBookCategories.SMITHING; } }