project dependency update

This commit is contained in:
2025-07-19 16:27:39 +02:00
parent 337727b0f0
commit 977f4ff4ec
6 changed files with 19 additions and 18 deletions

View File

@@ -1,6 +1,7 @@
package eu.mhsl.craftattack.spawn.core.util.world;
import net.kyori.adventure.key.Key;
import io.papermc.paper.registry.TypedKey;
import io.papermc.paper.registry.keys.SoundEventKeys;
import net.kyori.adventure.sound.Sound;
import org.bukkit.entity.Player;
@@ -15,23 +16,22 @@ public class InteractSounds {
this.player = player;
}
private void playSound(org.bukkit.Sound sound) {
this.player.playSound(this.getSound(sound.key()), Sound.Emitter.self());
}
private Sound getSound(Key soundKey) {
return Sound.sound(soundKey, Sound.Source.PLAYER, 1f, 1f);
private void playSound(TypedKey<org.bukkit.Sound> sound) {
this.player.playSound(
Sound.sound(sound, Sound.Source.PLAYER, 1f, 1f),
Sound.Emitter.self()
);
}
public void click() {
this.playSound(org.bukkit.Sound.UI_BUTTON_CLICK);
this.playSound(SoundEventKeys.UI_BUTTON_CLICK);
}
public void success() {
this.playSound(org.bukkit.Sound.ENTITY_PLAYER_LEVELUP);
this.playSound(SoundEventKeys.ENTITY_PLAYER_LEVELUP);
}
public void delete() {
this.playSound(org.bukkit.Sound.ENTITY_SILVERFISH_DEATH);
this.playSound(SoundEventKeys.ENTITY_SILVERFISH_DEATH);
}
}