Only call put on the model map if the replacement model is different
This commit is contained in:
parent
d1863cc66e
commit
675c58a437
|
|
@ -156,7 +156,11 @@ public class ModelBakeEventHelper {
|
|||
ModernFix.LOGGER.warn("Mod '{}' is calling replaceAll on the model registry. This requires temporarily loading every model for that mod, which is slow.", modId);
|
||||
List<ResourceLocation> locations = new ArrayList<>(keySet());
|
||||
for(ResourceLocation location : locations) {
|
||||
put(location, function.apply(location, get(location)));
|
||||
BakedModel existing = get(location);
|
||||
BakedModel replacement = function.apply(location, existing);
|
||||
if(replacement != existing) {
|
||||
put(location, replacement);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user