Interface ModelResolver
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Model resolvers are able to provide a custom model for specific
Identifier
s.
In vanilla, these Identifier
s are converted to file paths and used to load
a model from JSON. Since model resolvers override this process, they can be used to
create custom model formats.
Only one resolver may provide a custom model for a certain Identifier
.
Thus, resolvers that load models using a custom format could conflict. To avoid
conflicts, such resolvers may want to only load files with a mod-suffixed name
or only load files that have been explicitly defined elsewhere.
If it is necessary to load and bake an arbitrary model that is not referenced
normally, a model resolver can be used in conjunction with
ModelLoadingPlugin.Context.addModels(net.minecraft.util.Identifier...)
to directly load and bake custom model
instances.
Model resolvers are invoked for every single model that will be loaded, so implementations should be as efficient as possible.
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
The context for model resolution. -
Method Summary
Modifier and TypeMethodDescription@Nullable UnbakedModel
resolveModel
(ModelResolver.Context context)
-
Method Details
-
resolveModel
- Returns:
- the resolved
UnbakedModel
, ornull
if this resolver does not handle the currentIdentifier
-