Don't ignore deprecated methods if they used to be valid

This commit is contained in:
libraryaddict 2020-10-21 11:14:34 +13:00
parent 331133f1a1
commit c0ff4960aa

View File

@ -4,6 +4,7 @@ import me.libraryaddict.disguise.LibsDisguises;
import me.libraryaddict.disguise.disguisetypes.DisguiseType; import me.libraryaddict.disguise.disguisetypes.DisguiseType;
import me.libraryaddict.disguise.disguisetypes.FlagWatcher; import me.libraryaddict.disguise.disguisetypes.FlagWatcher;
import me.libraryaddict.disguise.utilities.params.ParamInfoManager; 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.ReflectionManager;
import me.libraryaddict.disguise.utilities.reflection.asm.WatcherInfo; import me.libraryaddict.disguise.utilities.reflection.asm.WatcherInfo;
@ -99,7 +100,8 @@ public class DisguiseMethods {
continue; continue;
} else if (method.getName().startsWith("get")) { } else if (method.getName().startsWith("get")) {
continue; continue;
} else if (method.isAnnotationPresent(Deprecated.class)) { } else if (method.isAnnotationPresent(Deprecated.class) &&
!method.isAnnotationPresent(NmsRemovedIn.class)) {
continue; continue;
} else if (!method.getReturnType().equals(Void.TYPE)) { } else if (!method.getReturnType().equals(Void.TYPE)) {
continue; continue;
@ -109,8 +111,7 @@ public class DisguiseMethods {
watcherMethods.computeIfAbsent(watcher, (a) -> new ArrayList<>()).add(method); watcherMethods.computeIfAbsent(watcher, (a) -> new ArrayList<>()).add(method);
} }
} } catch (IOException | ClassNotFoundException | NoClassDefFoundError | NoSuchMethodException e) {
catch (IOException | ClassNotFoundException | NoClassDefFoundError | NoSuchMethodException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }