Fixed ear ringing sound effect not triggering reliably

This commit is contained in:
Sollace 2022-12-23 20:54:42 +01:00
parent 0d6c265845
commit 97fa83e42a

View file

@ -13,6 +13,7 @@ import com.minelittlepony.unicopia.ability.magic.CasterView;
import com.minelittlepony.unicopia.block.data.Ether; import com.minelittlepony.unicopia.block.data.Ether;
import com.minelittlepony.unicopia.client.gui.DismissSpellScreen; import com.minelittlepony.unicopia.client.gui.DismissSpellScreen;
import com.minelittlepony.unicopia.client.sound.*; import com.minelittlepony.unicopia.client.sound.*;
import com.minelittlepony.unicopia.entity.effect.SunBlindnessStatusEffect;
import com.minelittlepony.unicopia.entity.effect.UEffects; import com.minelittlepony.unicopia.entity.effect.UEffects;
import com.minelittlepony.unicopia.entity.player.PlayerPhysics; import com.minelittlepony.unicopia.entity.player.PlayerPhysics;
import com.minelittlepony.unicopia.entity.player.Pony; import com.minelittlepony.unicopia.entity.player.Pony;
@ -73,7 +74,7 @@ public class ClientInteractionManager extends InteractionManager {
if (type == SOUND_EARS_RINGING && source instanceof LivingEntity) { if (type == SOUND_EARS_RINGING && source instanceof LivingEntity) {
soundManager.play(new LoopingSoundInstance<>((LivingEntity)source, soundManager.play(new LoopingSoundInstance<>((LivingEntity)source,
createTicker(100).and(e -> e.hasStatusEffect(UEffects.SUN_BLINDNESS)), createTicker(100).and(e -> !e.isRemoved()),
USounds.ENTITY_PLAYER_EARS_RINGING, 0.01F, 2, Random.create(seed)).setFadeIn() USounds.ENTITY_PLAYER_EARS_RINGING, 0.01F, 2, Random.create(seed)).setFadeIn()
); );
} else if (type == SOUND_BEE && source instanceof BeeEntity) { } else if (type == SOUND_BEE && source instanceof BeeEntity) {