package top.r3944realms.lib39.base.datagen.provider;

import net.minecraft.data.PackOutput;
import net.minecraftforge.common.data.ExistingFileHelper;
import net.minecraftforge.common.data.SoundDefinition;
import net.minecraftforge.common.data.SoundDefinitionsProvider;
import top.r3944realms.lib39.Lib39;
import top.r3944realms.lib39.content.register.Lib39SoundEvents;

/**
 * The type Lib 39 sound definitions provider.
 */
public class Lib39SoundDefinitionsProvider extends SoundDefinitionsProvider {
    /**
     * Instantiates a new Lib 39 sound definitions provider.
     *
     * @param output the output
     * @param helper the helper
     */
    public Lib39SoundDefinitionsProvider(PackOutput output, ExistingFileHelper helper) {
        super(output, Lib39.MOD_ID, helper);
    }

    /**
     * Gets sound definition.
     *
     * @param subTitle the sub title
     * @param sounds   the sounds
     * @return the sound definition
     */
    public SoundDefinition getSoundDefinition(String subTitle, SoundDefinition.Sound... sounds) {
        return SoundDefinition.definition().subtitle(subTitle).with(sounds);
    }

    @Override
    public void registerSounds() {
        add(
                Lib39SoundEvents.DUCK_TOY,
                getSoundDefinition(
                        Lib39SoundEvents.getSubTitleTranslateKey("duck_toy"),
                        sound(Lib39SoundEvents.RL_DUCK_TOY, SoundDefinition.SoundType.SOUND)
                )
        );
    }
}
