Interface ModelModifier.OnLoad
- Enclosing class:
ModelModifier
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
The context for an on load model modification event. -
Method Summary
Modifier and TypeMethodDescription@Nullable UnbakedModel
modifyModelOnLoad
(@Nullable UnbakedModel model, ModelModifier.OnLoad.Context context) This handler is invoked to allow modification of an unbaked model right after it is first loaded and before it is cached.
-
Method Details
-
modifyModelOnLoad
@Nullable @Nullable UnbakedModel modifyModelOnLoad(@Nullable @Nullable UnbakedModel model, ModelModifier.OnLoad.Context context) This handler is invoked to allow modification of an unbaked model right after it is first loaded and before it is cached.If the given model is
null
, its corresponding identifier was requested during resolution but the model was not loaded normally; i.e. through a JSON file, possibly because that file did not exist. If a non-null
model is returned in this case, resolution will continue without warnings or errors. This callback can return anull
model, which has the same meaning as described earlier, so it is unlikely that an implementor should need to returnnull
unless directly returning the given model.For further information, see the docs of
ModelLoadingPlugin.Context.modifyModelOnLoad()
.- Parameters:
model
- the current unbaked model instancecontext
- context with additional information about the model/loader- Returns:
- the model that should be used in this scenario. If no changes are needed, just return
model
as-is. - See Also:
-