Merge pull request #2091 from shadekiller666/ItemModelLoadingFix

Fixed a bug with item model loading
This commit is contained in:
Fry 2015-10-27 09:59:50 +03:00
commit cf568ae85f
1 changed files with 12 additions and 5 deletions

View File

@ -217,13 +217,20 @@ public class ModelLoader extends ModelBakery
throw new IllegalStateException("circular model dependencies involving model " + location);
}
loadingModels.add(location);
IModel model = ModelLoaderRegistry.getModel(location);
for(ResourceLocation dep : model.getDependencies())
try
{
getModel(dep);
IModel model = ModelLoaderRegistry.getModel(location);
for (ResourceLocation dep : model.getDependencies())
{
getModel(dep);
}
textures.addAll(model.getTextures());
}
finally
{
loadingModels.remove(location);
}
textures.addAll(model.getTextures());
loadingModels.remove(location);
}
private class VanillaModelWrapper implements IRetexturableModel