project: we are actually up to date now, thanks blue!

This commit is contained in:
TheRealNull
2021-01-04 06:58:20 -05:00
parent d0c8a8daec
commit b5bb349259
79 changed files with 668 additions and 335 deletions

View File

@@ -31,6 +31,9 @@ tasks.register<JavaExec>("inject") {
main = "com.openosrs.injector.Injector"
classpath = sourceSets["main"].runtimeClasspath
args(vanillaDep.singleFile, openosrsVersion)
outputs.upToDateWhen {
false
}
}
tasks {

View File

@@ -118,9 +118,9 @@ public class RSApiInjector extends AbstractInjector
final Signature sig = apiMethod.getSignature();
if (sig.isVoid())
if (sig.size() == 1)
{
if (sig.size() == 1)
if (sig.isVoid() || sig.getReturnValue().equals(Type.fromAsmString(apiMethod.getClazz().getName())))
{
Type type = InjectUtil.apiToDeob(inject, sig.getTypeOfArg(0));
if (deobType.equals(type))
@@ -276,7 +276,7 @@ public class RSApiInjector extends AbstractInjector
final ClassFile targetClass = InjectUtil.vanillaFromApiMethod(inject, apiMethod);
apiMethod.setInjected(true);
if (apiMethod.getSignature().isVoid())
if (apiMethod.getSignature().getArguments().size() == 1)
{
++set;
log.debug("[DEBUG] Injecting setter {} for {} into {}", apiMethod.getMethod(), field.getPoolField(), targetClass.getPoolClass());

View File

@@ -102,7 +102,15 @@ public class InjectSetter
ins.add(new PutField(instructions, field));
}
ins.add(new VReturn(instructions));
if (!apiMethod.getSignature().getReturnValue().equals(Type.VOID))
{
ins.add(new ALoad(instructions, 0));
ins.add(InjectUtil.createReturnForType(instructions, apiMethod.getSignature().getReturnValue()));
}
else
{
ins.add(new VReturn(instructions));
}
targetClass.addMethod(method);
}