package net.minecraft.world.level.levelgen;

import com.mojang.datafixers.kinds.Applicative;
import com.mojang.serialization.Lifecycle;
import java.util.function.Function;
import net.minecraft.util.Codecs;
import com.mojang.datafixers.kinds.App;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import com.mojang.serialization.Codec;

public class NoiseSettings {
    public static final Codec<NoiseSettings> CODEC;
    private final int height;
    private final NoiseSamplingSettings noiseSamplingSettings;
    private final NoiseSlideSettings topSlideSettings;
    private final NoiseSlideSettings bottomSlideSettings;
    private final int noiseSizeHorizontal;
    private final int noiseSizeVertical;
    private final double densityFactor;
    private final double densityOffset;
    private final boolean useSimplexSurfaceNoise;
    private final boolean randomDensityOffset;
    private final boolean islandNoiseOverride;
    private final boolean isAmplified;
    
    public NoiseSettings(final int integer1, final NoiseSamplingSettings cir, final NoiseSlideSettings cit3, final NoiseSlideSettings cit4, final int integer5, final int integer6, final double double7, final double double8, final boolean boolean9, final boolean boolean10, final boolean boolean11, final boolean boolean12) {
        this.height = integer1;
        this.noiseSamplingSettings = cir;
        this.topSlideSettings = cit3;
        this.bottomSlideSettings = cit4;
        this.noiseSizeHorizontal = integer5;
        this.noiseSizeVertical = integer6;
        this.densityFactor = double7;
        this.densityOffset = double8;
        this.useSimplexSurfaceNoise = boolean9;
        this.randomDensityOffset = boolean10;
        this.islandNoiseOverride = boolean11;
        this.isAmplified = boolean12;
    }
    
    public int height() {
        return this.height;
    }
    
    public NoiseSamplingSettings noiseSamplingSettings() {
        return this.noiseSamplingSettings;
    }
    
    public NoiseSlideSettings topSlideSettings() {
        return this.topSlideSettings;
    }
    
    public NoiseSlideSettings bottomSlideSettings() {
        return this.bottomSlideSettings;
    }
    
    public int noiseSizeHorizontal() {
        return this.noiseSizeHorizontal;
    }
    
    public int noiseSizeVertical() {
        return this.noiseSizeVertical;
    }
    
    public double densityFactor() {
        return this.densityFactor;
    }
    
    public double densityOffset() {
        return this.densityOffset;
    }
    
    @Deprecated
    public boolean useSimplexSurfaceNoise() {
        return this.useSimplexSurfaceNoise;
    }
    
    @Deprecated
    public boolean randomDensityOffset() {
        return this.randomDensityOffset;
    }
    
    @Deprecated
    public boolean islandNoiseOverride() {
        return this.islandNoiseOverride;
    }
    
    @Deprecated
    public boolean isAmplified() {
        return this.isAmplified;
    }
    
    static {
        CODEC = RecordCodecBuilder.create(instance -> ((RecordCodecBuilder.Instance)instance).group((App)Codecs.intRange(0, 256).fieldOf("height").forGetter((Function)NoiseSettings::height), (App)NoiseSamplingSettings.CODEC.fieldOf("sampling").forGetter((Function)NoiseSettings::noiseSamplingSettings), (App)NoiseSlideSettings.CODEC.fieldOf("top_slide").forGetter((Function)NoiseSettings::topSlideSettings), (App)NoiseSlideSettings.CODEC.fieldOf("bottom_slide").forGetter((Function)NoiseSettings::bottomSlideSettings), (App)Codecs.intRange(1, 4).fieldOf("size_horizontal").forGetter((Function)NoiseSettings::noiseSizeHorizontal), (App)Codecs.intRange(1, 4).fieldOf("size_vertical").forGetter((Function)NoiseSettings::noiseSizeVertical), (App)Codec.DOUBLE.fieldOf("density_factor").forGetter((Function)NoiseSettings::densityFactor), (App)Codec.DOUBLE.fieldOf("density_offset").forGetter((Function)NoiseSettings::densityOffset), (App)Codec.BOOL.fieldOf("simplex_surface_noise").forGetter((Function)NoiseSettings::useSimplexSurfaceNoise), (App)Codec.BOOL.optionalFieldOf("random_density_offset", false, Lifecycle.experimental()).forGetter((Function)NoiseSettings::randomDensityOffset), (App)Codec.BOOL.optionalFieldOf("island_noise_override", false, Lifecycle.experimental()).forGetter((Function)NoiseSettings::islandNoiseOverride), (App)Codec.BOOL.optionalFieldOf("amplified", false, Lifecycle.experimental()).forGetter((Function)NoiseSettings::isAmplified)).apply(instance, NoiseSettings::new));
    }
}
