Interface ModelModifier.OnLoad.Context
- Enclosing interface:
ModelModifier.OnLoad
@NonExtendable
public static interface ModelModifier.OnLoad.Context
The context for an on load model modification event.
-
Method Summary
Modifier and TypeMethodDescriptionLoads a model using anIdentifier
, or gets it if it was already loaded.loader()
The current model loader instance, which changes between resource reloads.@UnknownNullability("#topLevelId() != null") Identifier
Models with a resource ID are loaded directly from JSON or aModelModifier
.@UnknownNullability("#resourceId() != null") ModelIdentifier
Models with a top-level ID are loaded from blockstate files,BlockStateResolver
s, or by copying a previously loaded model.
-
Method Details
-
resourceId
@UnknownNullability("#topLevelId() != null") Identifier resourceId()Models with a resource ID are loaded directly from JSON or aModelModifier
.- Returns:
- the identifier of the given model as an
Identifier
, or null iftopLevelId()
is not null
-
topLevelId
@UnknownNullability("#resourceId() != null") ModelIdentifier topLevelId()Models with a top-level ID are loaded from blockstate files,BlockStateResolver
s, or by copying a previously loaded model.- Returns:
- the identifier of the given model as a
ModelIdentifier
, or null ifresourceId()
is not null
-
getOrLoadModel
Loads a model using anIdentifier
, or gets it if it was already loaded.- Parameters:
id
- the model identifier- Returns:
- the unbaked model, or a missing model if it is not present
-
loader
ModelLoader loader()The current model loader instance, which changes between resource reloads.
-