From 7eb9a89ef4abfeaf3d7131be3a73c5930996d2e6 Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Sat, 3 Sep 2016 17:00:02 -0500 Subject: [PATCH] Disable bergamute on custom sound classes. Closes #458 --- .../block/subtile/functional/BergamuteEventHandler.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/BergamuteEventHandler.java b/src/main/java/vazkii/botania/common/block/subtile/functional/BergamuteEventHandler.java index 5674b1c19..ebcad5145 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/BergamuteEventHandler.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/BergamuteEventHandler.java @@ -33,7 +33,7 @@ public class BergamuteEventHandler { public static void onSoundEvent(PlaySoundEvent evt) { ISound sound = evt.getResultSound(); - if (sound != null && shouldSilence(sound.getCategory())) { + if (sound != null && shouldSilence(sound)) { if(sound instanceof ITickableSound) { evt.setResultSound(new WrappedTickableSound((ITickableSound) sound, MULTIPLIER)); } else { @@ -51,8 +51,10 @@ public class BergamuteEventHandler { } } - private static boolean shouldSilence(SoundCategory category) { - return category != SoundCategory.VOICE && category != SoundCategory.MUSIC; + private static boolean shouldSilence(ISound sound) { + return sound.getCategory() != SoundCategory.VOICE + && sound.getCategory() != SoundCategory.MUSIC + && sound.getClass().getName().startsWith("net.minecraft.client.audio"); } @SideOnly(Side.CLIENT)