package net.minecraft.world.level.levelgen.placement;

import java.util.function.BiFunction;
import com.mojang.datafixers.kinds.Applicative;
import com.mojang.datafixers.kinds.App;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import com.mojang.serialization.Codec;
import net.minecraft.world.level.levelgen.feature.configurations.DecoratorConfiguration;

public class RangeDecoratorConfiguration implements DecoratorConfiguration {
    public static final Codec<RangeDecoratorConfiguration> CODEC;
    public final int min;
    public final int max;
    
    public RangeDecoratorConfiguration(final int integer1, final int integer2) {
        this.min = integer1;
        this.max = integer2;
    }
    
    static {
        CODEC = RecordCodecBuilder.create(instance -> ((RecordCodecBuilder.Instance)instance).group((App)Codec.INT.fieldOf("min").forGetter(csp -> csp.min), (App)Codec.INT.fieldOf("max").forGetter(csp -> csp.max)).apply(instance, (BiFunction)RangeDecoratorConfiguration::new));
    }
}
