From 759444090b418261b3fd227f9be2a70fde0c838b Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Tue, 28 Apr 2020 00:59:49 +1200 Subject: [PATCH] Fixed paper breaking in one of their latest updates --- .../disguise/utilities/reflection/ReflectionManager.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManager.java b/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManager.java index 8cfd5339..7854ccdd 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManager.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManager.java @@ -69,7 +69,7 @@ public class ReflectionManager { try { Object entity = createEntityInstance(DisguiseType.COW, "Cow"); - for (Method method : getNmsClass("EntityLiving").getDeclaredMethods()) { + for (Method method : getNmsClass("EntityCow").getDeclaredMethods()) { if (method.getReturnType() != float.class) continue; @@ -86,7 +86,8 @@ public class ReflectionManager { if ((float) method.invoke(entity) != 0.4f) continue; - damageAndIdleSoundMethod = method; + damageAndIdleSoundMethod = getNmsClass("EntityLiving").getDeclaredMethod(method.getName()); + damageAndIdleSoundMethod.setAccessible(true); break; } }