mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-30 16:28:00 +01:00
Might as well force this onto the client thread
This commit is contained in:
parent
90e4737910
commit
425a987776
1 changed files with 21 additions and 19 deletions
|
@ -49,26 +49,28 @@ public class ClientInteractionManager extends InteractionManager {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void playLoopingSound(Entity source, int type) {
|
public void playLoopingSound(Entity source, int type) {
|
||||||
SoundManager soundManager = client.getSoundManager();
|
client.execute(() -> {
|
||||||
|
SoundManager soundManager = client.getSoundManager();
|
||||||
|
|
||||||
if (type == SOUND_EARS_RINGING && source instanceof LivingEntity) {
|
if (type == SOUND_EARS_RINGING && source instanceof LivingEntity) {
|
||||||
soundManager.play(new LoopingSoundInstance<>((LivingEntity)source, e -> e.hasStatusEffect(SunBlindnessStatusEffect.INSTANCE), USounds.ENTITY_PLAYER_EARS_RINGING, 1F, 1F));
|
soundManager.play(new LoopingSoundInstance<>((LivingEntity)source, e -> e.hasStatusEffect(SunBlindnessStatusEffect.INSTANCE), USounds.ENTITY_PLAYER_EARS_RINGING, 1F, 1F));
|
||||||
} else if (type == SOUND_BEE && source instanceof BeeEntity) {
|
} else if (type == SOUND_BEE && source instanceof BeeEntity) {
|
||||||
soundManager.playNextTick(
|
soundManager.playNextTick(
|
||||||
((BeeEntity)source).hasAngerTime()
|
((BeeEntity)source).hasAngerTime()
|
||||||
? new AggressiveBeeSoundInstance(((BeeEntity)source))
|
? new AggressiveBeeSoundInstance(((BeeEntity)source))
|
||||||
: new PassiveBeeSoundInstance(((BeeEntity)source))
|
: new PassiveBeeSoundInstance(((BeeEntity)source))
|
||||||
);
|
);
|
||||||
} else if (type == SOUND_MINECART && source instanceof AbstractMinecartEntity) {
|
} else if (type == SOUND_MINECART && source instanceof AbstractMinecartEntity) {
|
||||||
soundManager.play(new MovingMinecartSoundInstance((AbstractMinecartEntity)source));
|
soundManager.play(new MovingMinecartSoundInstance((AbstractMinecartEntity)source));
|
||||||
} else if (type == SOUND_CHANGELING_BUZZ && source instanceof PlayerEntity) {
|
} else if (type == SOUND_CHANGELING_BUZZ && source instanceof PlayerEntity) {
|
||||||
soundManager.play(new LoopingSoundInstance<>((PlayerEntity)source, e -> {
|
soundManager.play(new LoopingSoundInstance<>((PlayerEntity)source, e -> {
|
||||||
PlayerPhysics physics = Pony.of(e).getPhysics();
|
PlayerPhysics physics = Pony.of(e).getPhysics();
|
||||||
return physics.isFlying() && physics.getFlightType() == FlightType.INSECTOID;
|
return physics.isFlying() && physics.getFlightType() == FlightType.INSECTOID;
|
||||||
}, USounds.ENTITY_PLAYER_CHANGELING_BUZZ, 1F, 1F));
|
}, USounds.ENTITY_PLAYER_CHANGELING_BUZZ, 1F, 1F));
|
||||||
} else if (type == SOUND_GLIDING && source instanceof PlayerEntity) {
|
} else if (type == SOUND_GLIDING && source instanceof PlayerEntity) {
|
||||||
soundManager.play(new MotionBasedSoundInstance(SoundEvents.ITEM_ELYTRA_FLYING, (PlayerEntity)source));
|
soundManager.play(new MotionBasedSoundInstance(SoundEvents.ITEM_ELYTRA_FLYING, (PlayerEntity)source));
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue