@FunctionalInterface public interface ModelResourceProvider
Model resource providers hook the loading of model *files* from the resource tree; that is, in vanilla, it handles going from "minecraft:block/stone" to a "assets/minecraft/models/block/stone.json" file.
This is where you want to add your own custom model formats.
As providers are instantiated with a new provider, it is safe (and recommended!) to cache information inside a loader.
Keep in mind that only *one* ModelResourceProvider may respond to a given model at any time. If you're writing, say, an OBJ loader, this means you could easily conflict with another OBJ loader unless you take some precautions, for example:
Modifier and Type | Method and Description |
---|---|
net.minecraft.client.render.model.UnbakedModel |
loadModelResource(net.minecraft.util.Identifier resourceId,
ModelProviderContext context) |
net.minecraft.client.render.model.UnbakedModel loadModelResource(net.minecraft.util.Identifier resourceId, ModelProviderContext context) throws ModelProviderException
resourceId
- The resource identifier to be loaded.ModelProviderException