Ok, I got it working!!!
This is what I did:
I put a file named entitytest.png inside textures/entities/ of my jar
User will put a new texture in this folder .minecraft\
When he clicks the button, I execute this piece of magic code:
String textureName = "entitytest.png";
File textureFile = null;
try { textureFile = new File(Minecraft.getMinecraft().mcDataDir.getCanonicalPath(), textureName); } catch (Exception ex) {}
if (textureFile != null && textureFile.exists()) {
ResourceLocation MODEL_TEXTURE = Resources.OTHER_TESTMODEL_CUSTOM;
TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();
texturemanager.deleteTexture(MODEL_TEXTURE);
Object object = new ThreadDownloadImageData(textureFile, null, MODEL_TEXTURE, new ImageBufferDownload());
texturemanager.loadTexture(MODEL_TEXTURE, (ITextureObject)object);
return true;
} else {
return false;
}
Where Resources.OTHER_TESTMODEL_CUSTOM
is
new ResourceLocation(lostworld.lib.References.MODID,"textures/entities/entitytest.png");
;) ;)