Skip first baking in ModelLoader (#3621) (#3638)

This commit is contained in:
James Mitchell authored and LexManos committed 2017-01-17 13:19:58 -08:00
1 parent 376f172990
commit 6f361dafa8
1 file changed
+11
@@ -117,6 +117,7 @@ import com.google.common.collect.Sets;
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();
@@ -168,6 +169,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())