project(injector): Remove edge case checks and let the injector handle it
This commit is contained in:
@@ -457,17 +457,22 @@ public class MixinInjector extends AbstractInjector
|
|||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
Method copy = new Method(targetClass, mixinMethod.getName(), mixinMethod.getDescriptor());
|
Method method = targetClass.findMethod(mixinMethod.getName(), mixinMethod.getDescriptor());
|
||||||
moveCode(copy, mixinMethod.getCode());
|
|
||||||
copy.setAccessFlags(mixinMethod.getAccessFlags());
|
if (method == null)
|
||||||
copy.setPublic();
|
{
|
||||||
|
method = new Method(targetClass, mixinMethod.getName(), mixinMethod.getDescriptor());
|
||||||
|
targetClass.addMethod(method);
|
||||||
|
}
|
||||||
|
|
||||||
|
moveCode(method, mixinMethod.getCode());
|
||||||
|
method.setAccessFlags(mixinMethod.getAccessFlags());
|
||||||
|
method.setPublic();
|
||||||
assert mixinMethod.getExceptions().getExceptions().isEmpty();
|
assert mixinMethod.getExceptions().getExceptions().isEmpty();
|
||||||
|
|
||||||
setOwnersToTargetClass(mixinClass, targetClass, copy, copiedMethods);
|
setOwnersToTargetClass(mixinClass, targetClass, method, copiedMethods);
|
||||||
|
|
||||||
targetClass.addMethod(copy);
|
log.debug("[DEBUG] Injected mixin method {} to {}", method, targetClass);
|
||||||
|
|
||||||
log.debug("[DEBUG] Injected mixin method {} to {}", copy, targetClass);
|
|
||||||
++injected;
|
++injected;
|
||||||
}
|
}
|
||||||
else if (mixinMethod.findAnnotation(REPLACE) != null)
|
else if (mixinMethod.findAnnotation(REPLACE) != null)
|
||||||
|
|||||||
@@ -93,11 +93,6 @@ public class CopyRuneLiteClasses extends AbstractInjector
|
|||||||
|
|
||||||
for (Method method : runeLiteDeob.getMethods())
|
for (Method method : runeLiteDeob.getMethods())
|
||||||
{
|
{
|
||||||
if (className.equals("RuneLiteMenuEntry") && (method.getName().equals("getItemId") || method.getName().equals("getWidget") || method.getName().equals("getItemOp")))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
transformMethod(method);
|
transformMethod(method);
|
||||||
runeliteObjectVanilla.addMethod(method);
|
runeliteObjectVanilla.addMethod(method);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user