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

import com.mojang.datafixers.kinds.Applicative;
import com.mojang.datafixers.kinds.App;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import com.mojang.serialization.Codec;

public class CountRangeDecoratorConfiguration implements DecoratorConfiguration {
    public static final Codec<CountRangeDecoratorConfiguration> CODEC;
    public final int count;
    public final int bottomOffset;
    public final int topOffset;
    public final int maximum;
    
    public CountRangeDecoratorConfiguration(final int integer1, final int integer2, final int integer3, final int integer4) {
        this.count = integer1;
        this.bottomOffset = integer2;
        this.topOffset = integer3;
        this.maximum = integer4;
    }
    
    static {
        CODEC = RecordCodecBuilder.create(instance -> ((RecordCodecBuilder.Instance)instance).group((App)Codec.INT.fieldOf("count").forGetter(cnl -> cnl.count), (App)Codec.INT.fieldOf("bottom_offset").withDefault(0).forGetter(cnl -> cnl.bottomOffset), (App)Codec.INT.fieldOf("top_offset").withDefault(0).forGetter(cnl -> cnl.topOffset), (App)Codec.INT.fieldOf("maximum").withDefault(0).forGetter(cnl -> cnl.maximum)).apply(instance, CountRangeDecoratorConfiguration::new));
    }
}
