for(Field f : fields)
{
f.setAccessible(true);
if(ModelBase.class.isAssignableFrom(f.getType()))
{
ModelBase base = (ModelBase)f.get(rend);
if(base != null)
{
priorityLevel.add(base); // Add normal parent fields
}
}
else if(ModelBase[].class.isAssignableFrom(f.getType()))
{
ModelBase[] modelBases = (ModelBase[])f.get(rend);
if(modelBases != null)
{
for(ModelBase base : modelBases)
{
priorityLevel.add(base);
}
}
}
}
models.add(priorityLevel);
if(clz == RendererLivingEntity.class)
{
ArrayList<ModelBase> topPriority = new ArrayList<ModelBase>();
for(Field f : fields)
{
f.setAccessible(true);
if(ModelBase.class.isAssignableFrom(f.getType()) && (f.getName().equalsIgnoreCase("mainModel") || f.getName().equalsIgnoreCase("field_77045_g")))
{
ModelBase base = (ModelBase)f.get(rend);
if(base != null)
{
topPriority.add(base);
}
}
}
models.add(topPriority);
}
clz = clz.getSuperclass();
}
}
catch(Exception e)
{
throw new UnableToAccessFieldException(new String[0], e);
}
}
ModelBase base1 = null;
int priorityLevel = -1;
int size = -1;
int currentPriority = 0;