public boolean find(ClassGen cg) { if (!cg.isAbstract()) { return false; } for (Field f : cg.getFields()) { if (f.isStatic()) { continue; } if (f.getType().equals(types.get("StringWrapper"))) { setClassGen(cg); fields.put("getChat", f); } } if (!isFound()) { return false; } ConstantPoolGen cpg = cg.getConstantPool(); Method m = cg.containsMethod("", "()V"); if (m == null) { return false; } ByteSequence bytes = new ByteSequence(m.getCode().getCode()); try { Instruction i = Instruction.readInstruction(bytes); while (i != null) { if (i.equals(sipush)) { Field f = cg.containsField(((FieldInstruction)Instruction.readInstruction(bytes)).getFieldName(cpg)); fields.put("getHPBarLastCycle", f); break; } i = Instruction.readInstruction(bytes); } } catch (IOException e) { e.printStackTrace(); return false; } return true; }