Skip first baking in ModelLoader (#3621)

This commit is contained in:
Vincent Lee authored and LexManos committed 2017-01-11 18:33:13 -08:00
1 parent df0f1c4e75
commit a41288644d
1 file changed
+11
@@ -125,6 +125,7 @@ import javax.annotation.Nonnull;
public final class ModelLoader extends ModelBakery
{
private static boolean firstLoad = Boolean.parseBoolean(System.getProperty("fml.skipFirstModelBake", "true"));
private final Map<ModelResourceLocation, IModel> stateModels = Maps.newHashMap();
private final Set<ModelResourceLocation> missingVariants = Sets.newHashSet();
private final Map<ResourceLocation, Exception> loadingExceptions = Maps.newHashMap();
@@ -176,6 +177,16 @@ public final class ModelLoader extends ModelBakery
HashMultimap<IModel, ModelResourceLocation> models = HashMultimap.create();
Multimaps.invertFrom(Multimaps.forMap(stateModels), models);
if (firstLoad)
{
firstLoad = false;
for (ModelResourceLocation mrl : stateModels.keySet())
{
bakedRegistry.putObject(mrl, missingBaked);
}
return bakedRegistry;
}
ProgressBar bakeBar = ProgressManager.push("ModelLoader: baking", models.keySet().size());
for(IModel model : models.keySet())