Put the old version not working down to my carelessness in writing it, i forgot to set the model array to null so it never bothered loading lol =\.
Anyway;
To find the model class you need to use windows grep and search;
Right, so you may get a few classes but you can find the model loading yourself, so anyway, here is the 508 class;
Class1_Sub4.
Right, the model loading in new RuneScape client's dosn't use 2 method's for 1 type of model like 317, it loads either new header or old.
So, the actual model method is;
Code:
public Class1_Sub4(byte[] is) {
if (is[is.length - 1] == -1 && is[is.length - 2] == -1)
method108(is);
else
method126(is);
}
This is a refactored version;
Code:
public Model(byte[] modelBytes) {
if (modelBytes[modelBytes.length - 1] == -1 && modelBytes[modelBytes.length - 2] == -1)
loadNewFormat(modelBytes);
else
loadOldFormat(modelBytes);
}
Now, let's make the loader.
Make a new class called "ModelLoader.java";
Add this into it;
Code:
import java.io.*;
import java.util.*;
public class ModelLoader {
public static List<Integer> models = null;
public ModelLoader()
{
loadArray();
}
public static byte[] loadNewModel(int i) throws IOException
{
DataInputStream dis = new DataInputStream(new FileInputStream("./models/"+i+".dat"));
byte[] buffer = new byte[(int) new File("./models/"+i+".dat").length()];
dis.readFully(buffer);
dis.close();
return buffer;
}
public void loadArray()
{
models = new ArrayList<Integer>();
File[] m = new File("./models").listFiles();
for (File model : m)
if(model.getName().contains(".dat"))
models.add(Integer.parseInt(model.getName().substring(0, model.getName().indexOf(".dat"))));
}
}
Now, in your model class find this;
Code:
public static Class1_Sub4 method115(Class21 class21, int i, int i_160_) {
byte[] is = class21.method338(i_160_, 0, i);
if (is == null)
return null;
return new Class1_Sub4(is);
}
You would change it to something like this;
Code:
public static Class1_Sub4 method115(Class21 class21, int i, int i_160_) {
try {
if(ModelLoader.models == null)
new ModelLoader();
for (int modelStored : ModelLoader.models)
if(modelStored == i)
return new Class1_Sub4(ModelLoader.loadNewModel(modelStored));
byte[] is = class21.method338(i_160_, 0, i);
if (is == null)
return null;
return new Class1_Sub4(is);
} catch(Exception e) {
e.printStackTrace();
}
return null;
}
Now, make a new folder called models, add in old Rs model's or whatever, then in the ModelLoader class add more of these in loadArray();
You can let the loadArrays read the file and do it itself, but if it dosn't work for any reason you can add new models via that method using;
models.add(YOURIDHERE);
Another way would to be replace your "loadArray" method with this;
Then compile and run and you will load the model's you chose.
If you want to load old characters i posted a list in RSClient 317 section in config of every model.
Remember, don't gzip the models.
Here's a picture of what you can do, this is a custom model released in rs 317 client section;

And here is dragon claws;

By loading custom model's you have the same problems as in 317 where parts disapear, but you can load old RuneScape model's perfect, or new ones
.