Fixes more sound bugs

This commit is contained in:
Andrew 2013-05-30 06:20:50 +12:00
parent 19b61395ee
commit f1b76f622b
2 changed files with 7 additions and 5 deletions

@ -96,9 +96,8 @@ public class DisguiseAPI {
if (loc.equals(soundLoc)) { if (loc.equals(soundLoc)) {
DisguiseSound disSound = DisguiseSound.getType(entity.getType().name()); DisguiseSound disSound = DisguiseSound.getType(entity.getType().name());
if (disSound != null) { if (disSound != null) {
if (((CraftEntity) entity).getHandle().dead) { if (entity instanceof LivingEntity && ((LivingEntity) entity).getHealth() == 0) {
soundType = SoundType.DEATH; soundType = SoundType.DEATH;
System.out.print(soundType);
} else { } else {
boolean hasInvun = false; boolean hasInvun = false;
if (entity instanceof LivingEntity) { if (entity instanceof LivingEntity) {
@ -110,7 +109,6 @@ public class DisguiseAPI {
hasInvun = e.isInvulnerable(); hasInvun = e.isInvulnerable();
} }
soundType = disSound.getType(soundName, !hasInvun); soundType = disSound.getType(soundName, !hasInvun);
System.out.print(soundType + " " + hasInvun);
} }
if (soundType != null) { if (soundType != null) {
disguisedEntity = entity; disguisedEntity = entity;

@ -133,9 +133,13 @@ public enum DisguiseSound {
if (!disguiseSounds.containsKey(type) || type == SoundType.DEATH || (ignoreDamage && type == SoundType.HURT)) if (!disguiseSounds.containsKey(type) || type == SoundType.DEATH || (ignoreDamage && type == SoundType.HURT))
continue; continue;
Sound s = disguiseSounds.get(type); Sound s = disguiseSounds.get(type);
if (s != null) if (s != null) {
if (CraftSound.getSound(s).equals(name)) String soundName = CraftSound.getSound(s);
if (s == Sound.BLAZE_BREATH)
soundName = "mob.blaze.breathe";
if (soundName.equals(name))
return type; return type;
}
} }
return null; return null;
} }