From 18ea8e079c058cdbaaf8c4f87ef841978c291465 Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 23 Jul 2013 06:38:54 +1200 Subject: [PATCH] Fixed entity damage sounds and check if entity can age before modifying pitch --- src/me/libraryaddict/disguise/DisguiseAPI.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/me/libraryaddict/disguise/DisguiseAPI.java b/src/me/libraryaddict/disguise/DisguiseAPI.java index edd70182..e3eacef1 100644 --- a/src/me/libraryaddict/disguise/DisguiseAPI.java +++ b/src/me/libraryaddict/disguise/DisguiseAPI.java @@ -167,10 +167,11 @@ public class DisguiseAPI { // If the volume is the default if (soundType != SoundType.IDLE && ((Float) mods.read(4)).equals(entitySound.getDamageSoundVolume())) { - mods.write(4, entitySound.getDamageSoundVolume()); + mods.write(4, dSound.getDamageSoundVolume()); } // Here I assume its the default pitch as I can't calculate if its real. - if (disguise instanceof MobDisguise && disguisedEntity instanceof LivingEntity) { + if (disguise instanceof MobDisguise && disguisedEntity instanceof LivingEntity + && ((MobDisguise) disguise).doesDisguiseAge()) { boolean baby = ((CraftLivingEntity) disguisedEntity).getHandle().isBaby(); if (((MobDisguise) disguise).isAdult() == baby) { @@ -194,8 +195,6 @@ public class DisguiseAPI { // Max = 1.2 // Cap = 75.6 } - if (disguise.getType() == DisguiseType.BAT) - pitch *= 0.95F; pitch *= 63; if (pitch < 0) pitch = 0;