package net.minecraft.world.level.biome;

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.sounds.SoundEvent;
import com.mojang.serialization.Codec;

public class AmbientAdditionsSettings {
    public static final Codec<AmbientAdditionsSettings> CODEC;
    private SoundEvent soundEvent;
    private double tickChance;
    
    public AmbientAdditionsSettings(final SoundEvent ack, final double double2) {
        this.soundEvent = ack;
        this.tickChance = double2;
    }
    
    public SoundEvent getSoundEvent() {
        return this.soundEvent;
    }
    
    public double getTickChance() {
        return this.tickChance;
    }
    
    static {
        CODEC = RecordCodecBuilder.create(instance -> ((RecordCodecBuilder.Instance)instance).group((App)SoundEvent.CODEC.fieldOf("sound").forGetter(bqv -> bqv.soundEvent), (App)Codec.DOUBLE.fieldOf("tick_chance").forGetter(bqv -> bqv.tickChance)).apply(instance, (BiFunction)AmbientAdditionsSettings::new));
    }
}
