Don't bother checking if their sound type is a death or hurt or w/e

This commit is contained in:
libraryaddict 2022-02-28 22:00:48 +13:00
parent c2a26dacc2
commit 53b7e29171
2 changed files with 3 additions and 10 deletions

View File

@ -79,8 +79,7 @@ public class PacketListenerSounds extends PacketAdapter {
} }
if ((!(entity instanceof LivingEntity)) || ((LivingEntity) entity).getHealth() > 0) { if ((!(entity instanceof LivingEntity)) || ((LivingEntity) entity).getHealth() > 0) {
boolean hasInvun = ReflectionManager.hasInvul(entity); soundType = soundGroup.getType(soundEffectObj);
soundType = soundGroup.getType(soundEffectObj, !hasInvun);
} else { } else {
soundType = SoundType.DEATH; soundType = SoundType.DEATH;
} }

View File

@ -121,18 +121,12 @@ public class SoundGroup {
/** /**
* Used to check if this sound name is owned by this disguise sound. * Used to check if this sound name is owned by this disguise sound.
*/ */
public SoundType getType(Object sound, boolean ignoreDamage) { public SoundType getType(Object sound) {
if (sound == null) { if (sound == null) {
return SoundType.CANCEL; return SoundType.CANCEL;
} }
SoundType soundType = getSound(sound); return getSound(sound);
if (soundType == SoundType.DEATH || (ignoreDamage && soundType == SoundType.HURT)) {
return null;
}
return soundType;
} }
public boolean isCancelSound(String sound) { public boolean isCancelSound(String sound) {