You should remove the folloowing from getTexture() as it is already in the constructor. If someone removed all TextureStreamLocators then it’s his own fault:
if (textureStreamLocators.isEmpty()) {
// Added for noobs
addTextureStreamLocator(new TextureStreamLocatorFile(new File(".")));
}
also this:
if ((tex == null) && ((name.charAt(0) == '/') || (name.charAt(1) == ':'))) {
// locate the texture directly through its filename
tex = getTexture(new File(name), format, mipmap);
}
is bad, because getTexture(File …) addes the texture to the cache.
The cleanest solution would be to just create a TextureStreamLocatorAbsolute() which contains the above code and add this first (in the constructor) - this will result in much cleaner code without code duplication.
Ciao Matthias Mann