minecraft-src/net/minecraft/world/item/crafting/SmithingRecipe.java
2025-07-04 03:45:38 +03:00

31 lines
924 B
Java

package net.minecraft.world.item.crafting;
import java.util.Optional;
import net.minecraft.world.level.Level;
public interface SmithingRecipe extends Recipe<SmithingRecipeInput> {
@Override
default RecipeType<SmithingRecipe> getType() {
return RecipeType.SMITHING;
}
@Override
RecipeSerializer<? extends SmithingRecipe> 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<Ingredient> templateIngredient();
Ingredient baseIngredient();
Optional<Ingredient> additionIngredient();
@Override
default RecipeBookCategory recipeBookCategory() {
return RecipeBookCategories.SMITHING;
}
}