@FunctionalInterface public interface ModelVariantProvider
Model variant providers hook the resolution of ModelIdentifiers. In vanilla, this is
the part where a "minecraft:stone#normal" identifier triggers the loading of a
"minecraft:models/stone" model (ModelResourceProvider
handles the later step).
The most common use of this is to cooperate with a ModelAppender
, but it can
also allow you to add your own block- or item-state formats. To trigger the loading
of another model, use the passed ModelProviderContext
.
As every model loading is instantiated with a new provider, it is safe (and recommended!) to cache information.
Keep in mind that only *one* ModelVariantProvider may respond to a given model at any time.
Modifier and Type | Method and Description |
---|---|
net.minecraft.client.render.model.UnbakedModel |
loadModelVariant(net.minecraft.client.util.ModelIdentifier modelId,
ModelProviderContext context) |
net.minecraft.client.render.model.UnbakedModel loadModelVariant(net.minecraft.client.util.ModelIdentifier modelId, ModelProviderContext context) throws ModelProviderException
modelId
- The model identifier, complete with variant.ModelProviderException