Skip first baking in ModelLoader (#3621)

This commit is contained in:
Vincent Lee 2017-01-11 20:33:13 -06:00 committed by LexManos
parent df0f1c4e75
commit a41288644d

View file

@ -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())