package top.r3944realms.lib39.core.register;

import net.minecraft.sounds.SoundEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import top.r3944realms.lib39.Lib39;

/**
 * The type Lib 39 sound events.
 */
public class ForgeLib39SoundEvents {
    /**
     * The constant SOUND_EVENTS.
     */
    public static final DeferredRegister<SoundEvent> SOUND_EVENTS = DeferredRegister.create(ForgeRegistries.SOUND_EVENTS, Lib39.MOD_ID);

    static {
        Lib39SoundEvents.DUCK_TOY = SOUND_EVENTS.register("duck_toy",
                () -> SoundEvent.createFixedRangeEvent(Lib39SoundEvents.RL_DUCK_TOY, 32.0f));
    }

    /**
     * Register.
     *
     * @param bus the bus
     */
    public static void register(IEventBus bus) {
        SOUND_EVENTS.register(bus);
    }


    /**
     * Gets sub title translate key.
     *
     * @param name the name
     * @return the sub title translate key
     */
    public static String getSubTitleTranslateKey(String name) {
        return "sound." + Lib39.MOD_ID + ".subtitle." + name;
    }
}
