Changes pitch for working sound
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good

This commit is contained in:
Kristian Knarvik 2024-07-28 17:20:51 +02:00
parent 384893b01a
commit 523e4cb47a

View File

@ -171,14 +171,14 @@ public abstract class Session implements Runnable {
* @param sound <p>The sound to play</p> * @param sound <p>The sound to play</p>
*/ */
protected void playSound(Sound sound) { protected void playSound(Sound sound) {
playSound(this.npc.getEntity(), sound, 1.0F); playSound(this.npc.getEntity(), sound);
} }
/** /**
* Plays the working NPC sound * Plays the working NPC sound
*/ */
protected void playWorkSound() { protected void playWorkSound() {
playSound(this.npc.getEntity(), Sound.ITEM_ARMOR_EQUIP_NETHERITE, 0.5f); playSound(this.npc.getEntity(), Sound.ITEM_ARMOR_EQUIP_NETHERITE);
} }
/** /**
@ -186,15 +186,14 @@ public abstract class Session implements Runnable {
* *
* @param entity <p>The entity that should play the sound</p> * @param entity <p>The entity that should play the sound</p>
* @param sound <p>The sound to play</p> * @param sound <p>The sound to play</p>
* @param pitch <p>The pitch to play the sound at</p>
*/ */
private void playSound(@NotNull Entity entity, @NotNull Sound sound, float pitch) { private void playSound(@NotNull Entity entity, @NotNull Sound sound) {
World world = entity.getLocation().getWorld(); World world = entity.getLocation().getWorld();
if (world == null) { if (world == null) {
return; return;
} }
NPCSoundEvent event = new NPCSoundEvent(this.npc, this.player, SoundCategory.AMBIENT, sound, 0.5f, pitch); NPCSoundEvent event = new NPCSoundEvent(this.npc, this.player, SoundCategory.AMBIENT, sound, 0.5f, 1.0f);
BlacksmithPlugin.getInstance().callEvent(event); BlacksmithPlugin.getInstance().callEvent(event);
if (event.isCancelled()) { if (event.isCancelled()) {
return; return;