Item parallel model loading
This commit is contained in:
parent
185da209ce
commit
05b89607a5
1 changed files with 9 additions and 11 deletions
|
@ -90,17 +90,15 @@ public abstract class ModelBakeryMixin {
|
|||
}
|
||||
});
|
||||
|
||||
Registry.ITEM.forEach(item -> {
|
||||
if (item instanceof ItemModelProvider) {
|
||||
ResourceLocation registryID = Registry.ITEM.getKey(item);
|
||||
ResourceLocation storageID = new ResourceLocation(registryID.getNamespace(), "models/item/" + registryID.getPath() + ".json");
|
||||
if (!resourceManager.hasResource(storageID)) {
|
||||
ResourceLocation itemID = new ModelResourceLocation(registryID.getNamespace(), registryID.getPath(), "inventory");
|
||||
ItemModelProvider provider = (ItemModelProvider) item;
|
||||
BlockModel model = provider.getItemModel(registryID);
|
||||
cache.put(itemID, model);
|
||||
topLevel.put(itemID, model);
|
||||
}
|
||||
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)) {
|
||||
ResourceLocation itemID = new ModelResourceLocation(registryID.getNamespace(), registryID.getPath(), "inventory");
|
||||
ItemModelProvider provider = (ItemModelProvider) item;
|
||||
BlockModel model = provider.getItemModel(registryID);
|
||||
cache.put(itemID, model);
|
||||
topLevel.put(itemID, model);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue