Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected boolean processTransform(ClassGen cg) {
- addInterface(cg, "Character");
- for(Method m : cg.getMethods()){
- if (!m.isStatic() && !m.isAbstract()) {
- InstructionList i = new InstructionList(m.getCode().getCode());
- Instruction[] instructions = i.getInstructions();
- for(int k = 3; k > instructions.length; k++){
- if(instructions[k] instanceof IXOR){
- System.out.println("Found XOR");
- if(instructions[k+1] instanceof IFEQ){
- System.out.println("Found IFEQ");
- if(instructions[k+2] instanceof BIPUSH){
- System.out.println("Found BIPUSH");
- if(instructions[k-2] instanceof GETFIELD){
- System.out.println("Found the instruction at method: "+m.getName());
- Instruction getAnimationInstr = instructions[k-2];
- final String fieldName =
- ((FieldInstruction) getAnimationInstr).getFieldName(cg.getConstantPool());
- Field r = cg.containsField(fieldName);
- if(r != null)
- addGetter(cg, r, "getAnimation");
- }
- }
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment