mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-08 14:36:44 +01:00
Play a sound when casting a spell successfully
This commit is contained in:
parent
f921beb062
commit
17c175c8ce
1 changed files with 3 additions and 1 deletions
|
@ -97,9 +97,11 @@ public class UnicornCastingAbility implements Ability<Hit> {
|
||||||
boolean remove = player.getSpellSlot().removeIf(spell, true);
|
boolean remove = player.getSpellSlot().removeIf(spell, true);
|
||||||
player.subtractEnergyCost(remove ? 2 : 4);
|
player.subtractEnergyCost(remove ? 2 : 4);
|
||||||
if (!remove) {
|
if (!remove) {
|
||||||
if (spell.apply(player) != null) {
|
if (spell.apply(player) == null) {
|
||||||
player.spawnParticles(ParticleTypes.LARGE_SMOKE, 6);
|
player.spawnParticles(ParticleTypes.LARGE_SMOKE, 6);
|
||||||
player.playSound(SoundEvents.ENTITY_ITEM_BREAK, 1, 0.5F);
|
player.playSound(SoundEvents.ENTITY_ITEM_BREAK, 1, 0.5F);
|
||||||
|
} else {
|
||||||
|
player.playSound(SoundEvents.BLOCK_BEACON_POWER_SELECT, 0.05F, 2.2F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue