use of net.runelite.mapping.Construct in project runelite by runelite.
the class InjectConstruct method inject.
public void inject(Map<ClassFile, java.lang.Class> implemented) throws InjectionException {
for (Entry<ClassFile, java.lang.Class> entry : implemented.entrySet()) {
Class<?> clazz = entry.getValue();
ClassFile cf = entry.getKey();
if (clazz == null) {
continue;
}
for (java.lang.reflect.Method method : clazz.getDeclaredMethods()) {
if (method.isSynthetic()) {
continue;
}
Construct construct = method.getAnnotation(Construct.class);
if (construct == null) {
continue;
}
String obfuscatedName = DeobAnnotations.getObfuscatedName(cf.getAnnotations());
if (obfuscatedName == null) {
obfuscatedName = cf.getName();
}
ClassGroup vanilla = inject.getVanilla();
ClassFile other = vanilla.findClass(obfuscatedName);
assert other != null : "unable to find vanilla class from obfuscated name: " + obfuscatedName;
injectConstruct(other, method);
}
}
}
Aggregations