package com.leisuretimedock.blasttravelreborn.datagen.provider;

import com.leisuretimedock.blasttravelreborn.content.item.BTRItems;
import net.minecraft.data.PackOutput;
import net.minecraft.data.recipes.FinishedRecipe;
import net.minecraft.data.recipes.RecipeCategory;
import net.minecraft.data.recipes.RecipeProvider;
import net.minecraft.data.recipes.ShapedRecipeBuilder;
import net.minecraft.tags.ItemTags;
import net.minecraft.world.item.Items;
import org.jetbrains.annotations.NotNull;

import java.util.function.Consumer;

public class BTRRecipeProvider extends RecipeProvider {
    public BTRRecipeProvider(PackOutput pOutput) {
        super(pOutput);
    }

    @Override
    protected void buildRecipes(@NotNull Consumer<FinishedRecipe> pWriter) {
        // 第二个配方（您提供的JSON转换而来）
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, BTRItems.CANNON_ITEM.get(), 1)
                .define('A', Items.IRON_BLOCK)
                .define('B', Items.STRING)
                .define('C', ItemTags.STONE_CRAFTING_MATERIALS)
                .define('D', Items.STICK)
                .define('E', ItemTags.LOGS)
                .pattern("  A")
                .pattern("BA ")
                .pattern("CDE")
                .unlockedBy("has_iron_block", has(Items.IRON_BLOCK))
                .save(pWriter);
    }
}
