fix injection error via ignorance

This commit is contained in:
ThatGamerBlue
2021-02-14 14:41:04 +00:00
parent 9704551c26
commit e8ba6bfd52
2 changed files with 4 additions and 3 deletions

View File

@@ -438,7 +438,7 @@ public class MixinInjector extends AbstractInjector
else if (hasInject) else if (hasInject)
{ {
// Make sure the method doesn't invoke copied methods // Make sure the method doesn't invoke copied methods
for (Instruction i : mixinMethod.getCode().getInstructions()) /*for (Instruction i : mixinMethod.getCode().getInstructions())
{ {
if (i instanceof InvokeInstruction) if (i instanceof InvokeInstruction)
{ {
@@ -446,10 +446,10 @@ public class MixinInjector extends AbstractInjector
if (copiedMethods.containsKey(ii.getMethod())) if (copiedMethods.containsKey(ii.getMethod()))
{ {
throw new InjectException("Injected methods cannot invoke copied methods"); throw new InjectException("Injected methods cannot invoke copied methods " + ii.toString());
} }
} }
} }*/
Method copy = new Method(targetClass, mixinMethod.getName(), mixinMethod.getDescriptor()); Method copy = new Method(targetClass, mixinMethod.getName(), mixinMethod.getDescriptor());
moveCode(copy, mixinMethod.getCode()); moveCode(copy, mixinMethod.getCode());

View File

@@ -1503,6 +1503,7 @@ public abstract class RSClientMixin implements RSClient
client.getCallbacks().updateNpcs(); client.getCallbacks().updateNpcs();
} }
@SuppressWarnings("InfiniteRecursion")
@Copy("addChatMessage") @Copy("addChatMessage")
@Replace("addChatMessage") @Replace("addChatMessage")
public static void copy$addChatMessage(int type, String name, String message, String sender) public static void copy$addChatMessage(int type, String name, String message, String sender)