Skip to content

Commit aa6f09b

Browse files
Prevent Happy Ghast from playing mount/dismount noises when silenced (#13807)
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
1 parent 944ce44 commit aa6f09b

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

paper-server/patches/sources/net/minecraft/world/entity/animal/happyghast/HappyGhast.java.patch

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
--- a/net/minecraft/world/entity/animal/happyghast/HappyGhast.java
22
+++ b/net/minecraft/world/entity/animal/happyghast/HappyGhast.java
3-
@@ -314,8 +_,12 @@
3+
@@ -300,7 +_,7 @@
4+
@Override
5+
protected void addPassenger(final Entity passenger) {
6+
if (!this.isVehicle()) {
7+
- this.level().playSound(null, this.getX(), this.getY(), this.getZ(), SoundEvents.HARNESS_GOGGLES_DOWN, this.getSoundSource(), 1.0F, 1.0F);
8+
+ this.playSound(SoundEvents.HARNESS_GOGGLES_DOWN, 1.0F, 1.0F); // Paper - don't play sound if silenced (Fixes MC-297169)
9+
}
10+
11+
super.addPassenger(passenger);
12+
@@ -314,16 +_,21 @@
413
}
514

615
@Override
@@ -15,9 +24,11 @@
1524
if (!this.level().isClientSide()) {
1625
this.setServerStillTimeout(10);
1726
}
18-
@@ -324,6 +_,7 @@
27+
28+
if (!this.isVehicle()) {
1929
this.clearHome();
20-
this.level().playSound(null, this.getX(), this.getY(), this.getZ(), SoundEvents.HARNESS_GOGGLES_UP, this.getSoundSource(), 1.0F, 1.0F);
30+
- this.level().playSound(null, this.getX(), this.getY(), this.getZ(), SoundEvents.HARNESS_GOGGLES_UP, this.getSoundSource(), 1.0F, 1.0F);
31+
+ this.playSound(SoundEvents.HARNESS_GOGGLES_UP, 1.0F, 1.0F); // Paper - don't play sound if silenced (Fixes MC-297169)
2132
}
2233
+ return true; // Paper - cancellable passengers
2334
}

0 commit comments

Comments
 (0)