Catch and log exceptions during model baking (#4609)

This commit is contained in:
Ben Staddon authored and LexManos committed 2018-01-18 13:14:33 -08:00
1 parent 196e03c921
commit 533b03300a
1 file changed
+11 -2
@@ -180,14 +180,23 @@ public final class ModelLoader extends ModelBakery
for(IModel model : models.keySet())
{
bakeBar.step("[" + Joiner.on(", ").join(models.get(model)) + "]");
String modelLocations = "[" + Joiner.on(", ").join(models.get(model)) + "]";
bakeBar.step(modelLocations);
if(model == getMissingModel())
{
bakedModels.put(model, missingBaked);
}
else
{
bakedModels.put(model, model.bake(model.getDefaultState(), DefaultVertexFormats.ITEM, DefaultTextureGetter.INSTANCE));
try
{
bakedModels.put(model, model.bake(model.getDefaultState(), DefaultVertexFormats.ITEM, DefaultTextureGetter.INSTANCE));
}
catch (Exception e)
{
FMLLog.log.error("Exception baking model for location(s) {}:", modelLocations, e);
bakedModels.put(model, missingBaked);
}
}
}