From 2180eb935bdf1ba9168ec2d4745eba90b16b73b7 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Fri, 17 Apr 2020 20:34:55 +1200 Subject: [PATCH] Fix sounds not working for entity damage, fixes #450 --- .../packets/packetlisteners/PacketListenerSounds.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerSounds.java b/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerSounds.java index b46eb1ae..09a6f588 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerSounds.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerSounds.java @@ -120,9 +120,8 @@ public class PacketListenerSounds extends PacketAdapter { try { if (entity instanceof LivingEntity) { - /* hasInvun = ReflectionManager.getNmsField("Entity", "noDamageTicks").getInt(nmsEntity) == - ReflectionManager.getNmsField("EntityLiving", "maxNoDamageTicks") - .getInt(nmsEntity);*/ + hasInvun = + ReflectionManager.getNmsField("Entity", "noDamageTicks").getInt(nmsEntity) > 0; } else { Class clazz = ReflectionManager.getNmsClass("DamageSource");