package net.minecraft.world.level.levelgen.feature.configurations;

import java.util.function.BiFunction;
import com.mojang.datafixers.kinds.Applicative;
import com.mojang.datafixers.kinds.App;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import net.minecraft.world.level.block.state.BlockState;
import com.mojang.serialization.Codec;

public class ReplaceBlockConfiguration implements FeatureConfiguration {
    public static final Codec<ReplaceBlockConfiguration> CODEC;
    public final BlockState target;
    public final BlockState state;
    
    public ReplaceBlockConfiguration(final BlockState cfj1, final BlockState cfj2) {
        this.target = cfj1;
        this.state = cfj2;
    }
    
    static {
        CODEC = RecordCodecBuilder.create(instance -> ((RecordCodecBuilder.Instance)instance).group((App)BlockState.CODEC.fieldOf("target").forGetter(coi -> coi.target), (App)BlockState.CODEC.fieldOf("state").forGetter(coi -> coi.state)).apply(instance, (BiFunction)ReplaceBlockConfiguration::new));
    }
}
