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

View File

@ -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;

View File

@ -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;
}