package net.minecraft.data.recipes;

import javax.annotation.Nullable;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.crafting.RecipeSerializer;
import com.google.gson.JsonObject;
import java.util.function.Consumer;
import net.minecraft.world.item.crafting.SimpleRecipeSerializer;

public class SpecialRecipeBuilder {
    private final SimpleRecipeSerializer<?> serializer;
    
    public SpecialRecipeBuilder(final SimpleRecipeSerializer<?> bhg) {
        this.serializer = bhg;
    }
    
    public static SpecialRecipeBuilder special(final SimpleRecipeSerializer<?> bhg) {
        return new SpecialRecipeBuilder(bhg);
    }
    
    public void save(final Consumer<FinishedRecipe> consumer, final String string) {
        consumer.accept(new FinishedRecipe() {
            @Override
            public void serializeRecipeData(final JsonObject jsonObject) {
            }
            
            @Override
            public RecipeSerializer<?> getType() {
                return SpecialRecipeBuilder.this.serializer;
            }
            
            @Override
            public ResourceLocation getId() {
                return new ResourceLocation(string);
            }
            
            @Nullable
            @Override
            public JsonObject serializeAdvancement() {
                return null;
            }
            
            @Override
            public ResourceLocation getAdvancementId() {
                return new ResourceLocation("");
            }
        });
    }
}
