From 17c175c8ce267441b55c91d1e3c2a9b8fd7eab6c Mon Sep 17 00:00:00 2001 From: Sollace Date: Fri, 24 Dec 2021 18:36:12 +0200 Subject: [PATCH] Play a sound when casting a spell successfully --- .../unicopia/ability/UnicornCastingAbility.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/minelittlepony/unicopia/ability/UnicornCastingAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/UnicornCastingAbility.java index a32942de..81179daf 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/UnicornCastingAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/UnicornCastingAbility.java @@ -97,9 +97,11 @@ public class UnicornCastingAbility implements Ability { boolean remove = player.getSpellSlot().removeIf(spell, true); player.subtractEnergyCost(remove ? 2 : 4); if (!remove) { - if (spell.apply(player) != null) { + if (spell.apply(player) == null) { player.spawnParticles(ParticleTypes.LARGE_SMOKE, 6); player.playSound(SoundEvents.ENTITY_ITEM_BREAK, 1, 0.5F); + } else { + player.playSound(SoundEvents.BLOCK_BEACON_POWER_SELECT, 0.05F, 2.2F); } } }