Skip to content

Commit ac91125

Browse files
Update UXExtension.kt
1 parent b0bb351 commit ac91125

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import org.bukkit.Color
44
import org.bukkit.Location
55
import org.bukkit.Particle
6+
import org.bukkit.Registry
67
import org.bukkit.Sound
78
import org.bukkit.block.BlockFace
89
import org.bukkit.entity.Player
@@ -233,7 +234,7 @@ data class SoundEffect(
233234
val pitch: Float = 1f
234235
) {
235236

236-
constructor(sound: Sound, volume: Float = 0.4f, pitch: Float = 1f) : this(sound.toString(), volume, pitch)
237+
constructor(sound: Sound, volume: Float = 0.4f, pitch: Float = 1f) : this(Registry.SOUNDS.getKey(sound).toString(), volume, pitch)
237238
fun play(player: Player) {
238239
player.playSound(player.location, sound, volume, pitch)
239240
}

0 commit comments

Comments
 (0)