package net.minecraft.world.item.crafting;

import net.minecraft.network.FriendlyByteBuf;
import com.google.gson.JsonObject;
import net.minecraft.resources.ResourceLocation;
import java.util.function.Function;

public class SimpleRecipeSerializer<T extends Recipe<?>> implements RecipeSerializer<T> {
    private final Function<ResourceLocation, T> constructor;
    
    public SimpleRecipeSerializer(final Function<ResourceLocation, T> function) {
        this.constructor = function;
    }
    
    @Override
    public T fromJson(final ResourceLocation uh, final JsonObject jsonObject) {
        return this.constructor.apply(uh);
    }
    
    @Override
    public T fromNetwork(final ResourceLocation uh, final FriendlyByteBuf mg) {
        return this.constructor.apply(uh);
    }
    
    @Override
    public void toNetwork(final FriendlyByteBuf mg, final T bmu) {
    }
}
