From b065fc1113977529831be5eab587c1612efdde79 Mon Sep 17 00:00:00 2001 From: CarsCupcake <84076092+CarsCupcake@users.noreply.github.com> Date: Mon, 19 Feb 2024 15:50:11 +0100 Subject: Low Quiver Notification. #880 --- src/main/java/at/hannibal2/skyhanni/utils/SoundUtils.kt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/main/java/at/hannibal2/skyhanni/utils') diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SoundUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/SoundUtils.kt index 42ca4ee00..f9a330f20 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/SoundUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/SoundUtils.kt @@ -1,5 +1,8 @@ package at.hannibal2.skyhanni.utils +import at.hannibal2.skyhanni.SkyHanniMod +import kotlinx.coroutines.delay +import kotlinx.coroutines.launch import net.minecraft.client.Minecraft import net.minecraft.client.audio.ISound import net.minecraft.client.audio.PositionedSound @@ -11,6 +14,7 @@ object SoundUtils { private val beepSound by lazy { createSound("random.orb", 1f) } private val clickSound by lazy { createSound("gui.button.press", 1f) } private val errorSound by lazy { createSound("mob.endermen.portal", 0f) } + val plingSound by lazy { createSound("note.pling", 1f) } val centuryActiveTimerAlert by lazy { createSound("skyhanni:centurytimer.active", 1f) } fun ISound.playSound() { @@ -57,6 +61,10 @@ object SoundUtils { clickSound.playSound() } + fun playPlingSound() { + plingSound.playSound() + } + fun command(args: Array) { if (args.isEmpty()) { ChatUtils.userError("Specify a sound effect to test") @@ -73,4 +81,13 @@ object SoundUtils { fun playErrorSound() { errorSound.playSound() } + + fun repeatSound(delay: Long, repeat: Int, sound: ISound) { + SkyHanniMod.coroutineScope.launch { + repeat(repeat) { + sound.playSound() + delay(delay) + } + } + } } -- cgit