Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip first baking in ModelLoader #3621

Merged
merged 4 commits into from Jan 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/main/java/net/minecraftforge/client/model/ModelLoader.java
Expand Up @@ -123,6 +123,7 @@

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();
Expand Down Expand Up @@ -174,6 +175,16 @@ public void registerSprites(TextureMap map)
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())
Expand Down