From 53b7e291716439af70b70d891642004b654e0b9e Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Mon, 28 Feb 2022 22:00:48 +1300 Subject: [PATCH] Don't bother checking if their sound type is a death or hurt or w/e --- .../packets/packetlisteners/PacketListenerSounds.java | 3 +-- .../disguise/utilities/sounds/SoundGroup.java | 10 ++-------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerSounds.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerSounds.java index 086621a2..9c42dfc6 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerSounds.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerSounds.java @@ -79,8 +79,7 @@ public class PacketListenerSounds extends PacketAdapter { } if ((!(entity instanceof LivingEntity)) || ((LivingEntity) entity).getHealth() > 0) { - boolean hasInvun = ReflectionManager.hasInvul(entity); - soundType = soundGroup.getType(soundEffectObj, !hasInvun); + soundType = soundGroup.getType(soundEffectObj); } else { soundType = SoundType.DEATH; } diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/sounds/SoundGroup.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/sounds/SoundGroup.java index 4c1f539e..658c7236 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/sounds/SoundGroup.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/sounds/SoundGroup.java @@ -121,18 +121,12 @@ public class SoundGroup { /** * 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) { return SoundType.CANCEL; } - SoundType soundType = getSound(sound); - - if (soundType == SoundType.DEATH || (ignoreDamage && soundType == SoundType.HURT)) { - return null; - } - - return soundType; + return getSound(sound); } public boolean isCancelSound(String sound) {