From 3c812b7fd73d26121afe8921ed1ff909e16d59c5 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Mon, 26 Jun 2017 11:35:08 +1200 Subject: [PATCH] Fix addPotionEffect --- .../disguise/disguisetypes/watchers/LivingWatcher.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/me/libraryaddict/disguise/disguisetypes/watchers/LivingWatcher.java b/src/me/libraryaddict/disguise/disguisetypes/watchers/LivingWatcher.java index 186a9dfe..cfa3bfa6 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/watchers/LivingWatcher.java +++ b/src/me/libraryaddict/disguise/disguisetypes/watchers/LivingWatcher.java @@ -31,7 +31,8 @@ public class LivingWatcher extends FlagWatcher { static { try { - getId = ReflectionManager.getNmsMethod("MobEffectList", "getId", ReflectionManager.getNmsClass("MobEffectList")); + getId = ReflectionManager + .getNmsMethod("MobEffectList", "getId", ReflectionManager.getNmsClass("MobEffectList")); Object REGISTRY = ReflectionManager.getNmsField("MobEffectList", "REGISTRY").get(null); for (Object next : ((Iterable) REGISTRY)) { @@ -96,7 +97,7 @@ public class LivingWatcher extends FlagWatcher { float f4 = 0.0F; try { for (int localMobEffect : potionEffects) { - int n = (Integer) getId.invoke(list.get(localMobEffect)); + int n = (Integer) getId.invoke(null, list.get(localMobEffect)); f1 += (n >> 16 & 0xFF) / 255.0F; f2 += (n >> 8 & 0xFF) / 255.0F; f3 += (n & 0xFF) / 255.0F;