Skip to content

Commit e3191da

Browse files
committed
fix: duplicate soundeffect
1 parent 01a7a36 commit e3191da

2 files changed

Lines changed: 7 additions & 14 deletions

File tree

src/main/kotlin/cc/modlabs/kpaper/extensions/UXExtension.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,13 @@ class Beat(private val sounds: List<SoundEffect>) {
227227
}
228228
}
229229

230-
class SoundEffect(private val sound: Sound, private val pitch: Float, private val volume: Float) {
230+
data class SoundEffect(
231+
val sound: Sound,
232+
val volume: Float = 0.4f,
233+
val pitch: Float = 1f
234+
) {
235+
236+
constructor(sound: String, volume: Float = 0.4f, pitch: Float = 1f) : this(Sound.valueOf(sound), volume, pitch)
231237
fun play(player: Player) {
232238
player.playSound(player.location, sound, volume, pitch)
233239
}

src/main/kotlin/cc/modlabs/kpaper/ux/SoundEffect.kt

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)