package top.r3944realms.lib39.content.register;

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

/**
 * The type Lib 39 sound events.
 */
public class Lib39SoundEvents {
    /**
     * The constant SOUND_EVENTS.
     */
    public static final DeferredRegister<SoundEvent> SOUND_EVENTS = DeferredRegister.create(ForgeRegistries.SOUND_EVENTS, Lib39.MOD_ID);
    /**
     * The constant RL_DUCK_TOY.
     */
    public static final ResourceLocation RL_DUCK_TOY = Lib39.rl("duck_toy");
    /**
     * The constant DUCK_TOY.
     */
    public static final RegistryObject<SoundEvent> DUCK_TOY = SOUND_EVENTS.register("duck_toy",
            () -> SoundEvent.createFixedRangeEvent(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;
    }
}
