Added 1.13.2 support, made backwards premium

This commit is contained in:
libraryaddict
2020-02-13 19:47:02 +13:00
parent 7fdbea1185
commit 1fcefbcdcc
49 changed files with 1114 additions and 539 deletions

View File

@@ -78,26 +78,18 @@ public class DisguiseParser {
getName = "get" + getName;
}
Method getMethod = null;
for (Method m : setMethod.getDeclaringClass().getDeclaredMethods()) {
if (!m.getName().equals(getName)) {
continue;
}
if (m.getParameterTypes().length > 0 || m.getReturnType() != setMethod.getParameterTypes()[0]) {
continue;
}
getMethod = m;
break;
}
Method getMethod = setMethod.getDeclaringClass().getMethod(getName);
if (getMethod == null) {
DisguiseUtilities.getLogger().severe(String
.format("No such method '%s' when looking for the companion of '%s' in '%s'", getName,
setMethod.getName(), setMethod.getDeclaringClass().getSimpleName()));
continue;
}else if (getMethod.getReturnType() != setMethod.getParameterTypes()[0]){
DisguiseUtilities.getLogger().severe(String
.format("Invalid return type of '%s' when looking for the companion of '%s' in '%s'", getName,
setMethod.getName(), setMethod.getDeclaringClass().getSimpleName()));
continue;
}
Object defaultValue = null;