Item parallel model loading

This commit is contained in:
paulevsGitch 2021-07-30 21:13:05 +03:00
parent 185da209ce
commit 05b89607a5

View file

@ -90,8 +90,7 @@ public abstract class ModelBakeryMixin {
}
});
Registry.ITEM.forEach(item -> {
if (item instanceof ItemModelProvider) {
Registry.ITEM.stream().filter(item -> item instanceof ItemModelProvider).parallel().forEach(item -> {
ResourceLocation registryID = Registry.ITEM.getKey(item);
ResourceLocation storageID = new ResourceLocation(registryID.getNamespace(), "models/item/" + registryID.getPath() + ".json");
if (!resourceManager.hasResource(storageID)) {
@ -101,7 +100,6 @@ public abstract class ModelBakeryMixin {
cache.put(itemID, model);
topLevel.put(itemID, model);
}
}
});
topLevelModels.putAll(topLevel);