From c0ff4960aa3f81b33a136b44558473c75b279c87 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Wed, 21 Oct 2020 11:14:34 +1300 Subject: [PATCH] Don't ignore deprecated methods if they used to be valid --- .../disguise/utilities/watchers/DisguiseMethods.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/utilities/watchers/DisguiseMethods.java b/src/main/java/me/libraryaddict/disguise/utilities/watchers/DisguiseMethods.java index 8490f1be..df582e42 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/watchers/DisguiseMethods.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/watchers/DisguiseMethods.java @@ -4,6 +4,7 @@ import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.disguisetypes.DisguiseType; import me.libraryaddict.disguise.disguisetypes.FlagWatcher; import me.libraryaddict.disguise.utilities.params.ParamInfoManager; +import me.libraryaddict.disguise.utilities.reflection.NmsRemovedIn; import me.libraryaddict.disguise.utilities.reflection.ReflectionManager; import me.libraryaddict.disguise.utilities.reflection.asm.WatcherInfo; @@ -99,7 +100,8 @@ public class DisguiseMethods { continue; } else if (method.getName().startsWith("get")) { continue; - } else if (method.isAnnotationPresent(Deprecated.class)) { + } else if (method.isAnnotationPresent(Deprecated.class) && + !method.isAnnotationPresent(NmsRemovedIn.class)) { continue; } else if (!method.getReturnType().equals(Void.TYPE)) { continue; @@ -109,8 +111,7 @@ public class DisguiseMethods { watcherMethods.computeIfAbsent(watcher, (a) -> new ArrayList<>()).add(method); } - } - catch (IOException | ClassNotFoundException | NoClassDefFoundError | NoSuchMethodException e) { + } catch (IOException | ClassNotFoundException | NoClassDefFoundError | NoSuchMethodException e) { e.printStackTrace(); } }