mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Fixed spell equip sound playing when opening the spellbook
This commit is contained in:
parent
72b5b3d50c
commit
b194f720ef
1 changed files with 5 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
|||
package com.minelittlepony.unicopia.entity.player;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import com.google.common.collect.Streams;
|
||||
import com.minelittlepony.unicopia.USounds;
|
||||
import com.minelittlepony.unicopia.ability.magic.spell.effect.CustomisedSpellType;
|
||||
|
@ -53,7 +55,9 @@ public class PlayerCharmTracker implements NbtSerialisable {
|
|||
public CustomisedSpellType<?> equipSpell(Hand hand, CustomisedSpellType<?> spell) {
|
||||
CustomisedSpellType<?> previous = handSpells[hand.ordinal()];
|
||||
handSpells[hand.ordinal()] = spell;
|
||||
if (!Objects.equals(previous, spell)) {
|
||||
pony.asEntity().playSound(USounds.GUI_SPELL_EQUIP.value(), 0.25F, 1.75F);
|
||||
}
|
||||
pony.setDirty();
|
||||
return previous;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue