}
if (!field.isStatic() && field.getName().equals("nativeid")) {
continue classloop;
}
}
RSClass sdtoolkit = data.addClass("SDToolkit", clazz.getClassName());
for (Method m : clazz.getMethods()) {
if (!m.isStatic()) {
for (Type t : m.getArgumentTypes()) {
if (t instanceof ArrayType && ((ArrayType) t).getBasicType() == Type.INT) {
ConstantPoolGen cpg = clazz.getConstantPool();
MethodGen gen = new MethodGen(m, clazz.getClassName(), cpg);
InstructionList il = gen.getInstructionList();
if (il == null) {
continue;
}
InstructionFinder f = new InstructionFinder(il);
Iterator e = f.search("ALOAD GETFIELD GETFIELD ALOAD GETFIELD GETFIELD");
if (e.hasNext()) {
InstructionHandle[] handles = (InstructionHandle[]) e.next();
String getviewport = ((GETFIELD) handles[1].getInstruction()).getFieldName(cpg);
e = f.search("ILOAD ALOAD GETFIELD if_icmplt ILOAD ALOAD GETFIELD if_icmple", handles[handles.length - 1]);
if (e.hasNext()) {
handles = (InstructionHandle[]) e.next();
String zmin = ((GETFIELD) handles[2].getInstruction()).getFieldName(cpg);
String zmax = ((GETFIELD) handles[6].getInstruction()).getFieldName(cpg);
e = f.search("ALOAD GETFIELD ALOAD GETFIELD GETFIELD ALOAD GETFIELD GETFIELD", handles[handles.length - 1]);
if (e.hasNext()) {
handles = (InstructionHandle[]) e.next();
String xscale = ((GETFIELD) handles[1].getInstruction()).getFieldName(cpg);
e = f.search("ALOAD GETFIELD ALOAD GETFIELD GETFIELD ALOAD GETFIELD GETFIELD", handles[handles.length - 1]);
if (e.hasNext()) {
handles = (InstructionHandle[]) e.next();
String yscale = ((GETFIELD) handles[1].getInstruction()).getFieldName(cpg);
e = f.search("ILOAD ALOAD GETFIELD if_icmplt ILOAD ALOAD GETFIELD if_icmpgt", handles[handles.length - 1]);
if (e.hasNext()) {
handles = (InstructionHandle[]) e.next();
String xmin = ((GETFIELD) handles[2].getInstruction()).getFieldName(cpg);
String xmax = ((GETFIELD) handles[6].getInstruction()).getFieldName(cpg);
e = f.search("ILOAD ALOAD GETFIELD if_icmplt ILOAD ALOAD GETFIELD if_icmpgt", handles[handles.length - 1]);
if (e.hasNext()) {
handles = (InstructionHandle[]) e.next();
String ymin = ((GETFIELD) handles[2].getInstruction()).getFieldName(cpg);
String ymax = ((GETFIELD) handles[6].getInstruction()).getFieldName(cpg);
sdtoolkit.addField("xMin", xmin);
sdtoolkit.addField("xMax", xmax);
sdtoolkit.addField("yMin", ymin);
sdtoolkit.addField("yMax", ymax);
sdtoolkit.addField("zMin", zmin);
sdtoolkit.addField("zMax", zmax);
sdtoolkit.addField("xScale", xscale);
sdtoolkit.addField("yScale", yscale);
for (Field field : clazz.getFields()) {
if (!field.isStatic() && field.getSignature().contains(data.getProperClass("SDViewport").className)) {
sdtoolkit.addField("Viewport", field.getName());
return true;
}
}
}
}