From 4110c66493ee809e8303abd5b9106a7d0a0fbf4b Mon Sep 17 00:00:00 2001 From: Sollace Date: Mon, 19 Dec 2022 23:08:30 +0100 Subject: [PATCH] Wing flags will now trigger a sound event --- .../minelittlepony/unicopia/entity/player/PlayerPhysics.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java index c7c3f460..a752e2d5 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java @@ -33,6 +33,7 @@ import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvents; import net.minecraft.util.math.*; import net.minecraft.util.math.random.Random; +import net.minecraft.world.event.GameEvent; public class PlayerPhysics extends EntityPhysics implements Tickable, Motion, NbtSerialisable { private static final int MAX_WALL_HIT_CALLDOWN = 30; @@ -260,6 +261,7 @@ public class PlayerPhysics extends EntityPhysics implements Tickab ticksToGlide = MAX_TICKS_TO_GLIDE; if (!SpellPredicate.IS_DISGUISE.isOn(pony)) { entity.playSound(type.getWingFlapSound(), 0.25F, 1); + entity.world.emitGameEvent(entity, GameEvent.ELYTRA_GLIDE, entity.getPos()); } } else { strafe *= 0.28; @@ -508,6 +510,7 @@ public class PlayerPhysics extends EntityPhysics implements Tickab flapping = false; if (!SpellPredicate.IS_DISGUISE.isOn(pony)) { entity.playSound(getFlightType().getWingFlapSound(), 0.5F, 1); + entity.world.emitGameEvent(entity, GameEvent.ELYTRA_GLIDE, entity.getPos()); } thrustScale = 1; }