From f1b76f622bb1041a7d6f0615b356f42912a62f64 Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 30 May 2013 06:20:50 +1200 Subject: [PATCH] Fixes more sound bugs --- src/me/libraryaddict/disguise/DisguiseAPI.java | 4 +--- .../disguise/DisguiseTypes/DisguiseSound.java | 8 ++++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/me/libraryaddict/disguise/DisguiseAPI.java b/src/me/libraryaddict/disguise/DisguiseAPI.java index ef5ef8b2..88f2eaaf 100644 --- a/src/me/libraryaddict/disguise/DisguiseAPI.java +++ b/src/me/libraryaddict/disguise/DisguiseAPI.java @@ -96,9 +96,8 @@ public class DisguiseAPI { if (loc.equals(soundLoc)) { DisguiseSound disSound = DisguiseSound.getType(entity.getType().name()); if (disSound != null) { - if (((CraftEntity) entity).getHandle().dead) { + if (entity instanceof LivingEntity && ((LivingEntity) entity).getHealth() == 0) { soundType = SoundType.DEATH; - System.out.print(soundType); } else { boolean hasInvun = false; if (entity instanceof LivingEntity) { @@ -110,7 +109,6 @@ public class DisguiseAPI { hasInvun = e.isInvulnerable(); } soundType = disSound.getType(soundName, !hasInvun); - System.out.print(soundType + " " + hasInvun); } if (soundType != null) { disguisedEntity = entity; diff --git a/src/me/libraryaddict/disguise/DisguiseTypes/DisguiseSound.java b/src/me/libraryaddict/disguise/DisguiseTypes/DisguiseSound.java index 97c5637d..5fbe53ff 100644 --- a/src/me/libraryaddict/disguise/DisguiseTypes/DisguiseSound.java +++ b/src/me/libraryaddict/disguise/DisguiseTypes/DisguiseSound.java @@ -133,9 +133,13 @@ public enum DisguiseSound { if (!disguiseSounds.containsKey(type) || type == SoundType.DEATH || (ignoreDamage && type == SoundType.HURT)) continue; Sound s = disguiseSounds.get(type); - if (s != null) - if (CraftSound.getSound(s).equals(name)) + if (s != null) { + String soundName = CraftSound.getSound(s); + if (s == Sound.BLAZE_BREATH) + soundName = "mob.blaze.breathe"; + if (soundName.equals(name)) return type; + } } return null; }