Adding Oak's graphic change transformer (#146)
This commit is contained in:
@@ -15,6 +15,7 @@ public class ActorTransform implements Transform {
|
|||||||
ct = ByteCodePatcher.classPool.get(actor.getName());
|
ct = ByteCodePatcher.classPool.get(actor.getName());
|
||||||
transformGetAnimation();
|
transformGetAnimation();
|
||||||
transformAnimationChanged();
|
transformAnimationChanged();
|
||||||
|
transformGraphicChanged();
|
||||||
ByteCodePatcher.modifiedClasses.add(ct);
|
ByteCodePatcher.modifiedClasses.add(ct);
|
||||||
} catch (NotFoundException e) {
|
} catch (NotFoundException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -54,4 +55,18 @@ public class ActorTransform implements Transform {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void transformGraphicChanged() {
|
||||||
|
try {
|
||||||
|
CtMethod graphicChanged = ct.getDeclaredMethod("graphicChanged", new CtClass[]{CtClass.intType});
|
||||||
|
ct.removeMethod(graphicChanged);
|
||||||
|
graphicChanged = CtNewMethod.make("public void graphicChanged(int paramInt){" +
|
||||||
|
" net.runelite.api.events.GraphicChanged localGraphicChanged = new net.runelite.api.events.GraphicChanged();" +
|
||||||
|
" localGraphicChanged.setActor(this);" +
|
||||||
|
" "+ByteCodePatcher.clientInstance+".getCallbacks().post(localGraphicChanged);}",ct);
|
||||||
|
ct.addMethod(graphicChanged);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user