Item parallel model loading
This commit is contained in:
parent
185da209ce
commit
05b89607a5
1 changed files with 9 additions and 11 deletions
|
@ -90,8 +90,7 @@ public abstract class ModelBakeryMixin {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Registry.ITEM.forEach(item -> {
|
Registry.ITEM.stream().filter(item -> item instanceof ItemModelProvider).parallel().forEach(item -> {
|
||||||
if (item instanceof ItemModelProvider) {
|
|
||||||
ResourceLocation registryID = Registry.ITEM.getKey(item);
|
ResourceLocation registryID = Registry.ITEM.getKey(item);
|
||||||
ResourceLocation storageID = new ResourceLocation(registryID.getNamespace(), "models/item/" + registryID.getPath() + ".json");
|
ResourceLocation storageID = new ResourceLocation(registryID.getNamespace(), "models/item/" + registryID.getPath() + ".json");
|
||||||
if (!resourceManager.hasResource(storageID)) {
|
if (!resourceManager.hasResource(storageID)) {
|
||||||
|
@ -101,7 +100,6 @@ public abstract class ModelBakeryMixin {
|
||||||
cache.put(itemID, model);
|
cache.put(itemID, model);
|
||||||
topLevel.put(itemID, model);
|
topLevel.put(itemID, model);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
topLevelModels.putAll(topLevel);
|
topLevelModels.putAll(topLevel);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue