aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/util/CommonSoundEffects.kt
blob: a4d712938011a9ff18e9bc1e46ff06eeb21731b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package moe.nea.firmament.util

import net.minecraft.client.resources.sounds.SimpleSoundInstance
import net.minecraft.sounds.SoundEvent
import net.minecraft.resources.ResourceLocation

// TODO: Replace these with custom sound events that just re use the vanilla ogg s
object CommonSoundEffects {
    fun playSound(identifier: ResourceLocation) {
        MC.soundManager.play(SimpleSoundInstance.forUI(SoundEvent.createVariableRangeEvent(identifier), 1F))
    }

    fun playFailure() {
        playSound(ResourceLocation.fromNamespaceAndPath("minecraft", "block.anvil.place"))
    }

    fun playSuccess() {
        playDing()
    }

    fun playDing() {
        playSound(ResourceLocation.fromNamespaceAndPath("minecraft", "entity.arrow.hit_player"))
    }
}