Fix sounds not working for entity damage, fixes #450

This commit is contained in:
libraryaddict 2020-04-17 20:34:55 +12:00
parent 5ac6731ec5
commit 2180eb935b
No known key found for this signature in database
GPG Key ID: 052E4FBCD257AEA4

View File

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