package net.minecraft.world.item.crafting;

import net.minecraft.core.NonNullList;
import net.minecraft.world.level.Level;
import net.minecraft.world.item.ItemStack;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.Container;

public abstract class AbstractCookingRecipe implements Recipe<Container> {
    protected final RecipeType<?> type;
    protected final ResourceLocation id;
    protected final String group;
    protected final Ingredient ingredient;
    protected final ItemStack result;
    protected final float experience;
    protected final int cookingTime;
    
    public AbstractCookingRecipe(final RecipeType<?> bmx, final ResourceLocation uh, final String string, final Ingredient bmr, final ItemStack bki, final float float6, final int integer) {
        this.type = bmx;
        this.id = uh;
        this.group = string;
        this.ingredient = bmr;
        this.result = bki;
        this.experience = float6;
        this.cookingTime = integer;
    }
    
    @Override
    public boolean matches(final Container amz, final Level bqb) {
        return this.ingredient.test(amz.getItem(0));
    }
    
    @Override
    public ItemStack assemble(final Container amz) {
        return this.result.copy();
    }
    
    @Override
    public boolean canCraftInDimensions(final int integer1, final int integer2) {
        return true;
    }
    
    @Override
    public NonNullList<Ingredient> getIngredients() {
        final NonNullList<Ingredient> gi2 = NonNullList.<Ingredient>create();
        gi2.add(this.ingredient);
        return gi2;
    }
    
    public float getExperience() {
        return this.experience;
    }
    
    @Override
    public ItemStack getResultItem() {
        return this.result;
    }
    
    @Override
    public String getGroup() {
        return this.group;
    }
    
    public int getCookingTime() {
        return this.cookingTime;
    }
    
    @Override
    public ResourceLocation getId() {
        return this.id;
    }
    
    @Override
    public RecipeType<?> getType() {
        return this.type;
    }
}
