Interface ModelLoadingPlugin.Context
- Enclosing interface:
ModelLoadingPlugin
@NonExtendable
public static interface ModelLoadingPlugin.Context
-
Method Summary
Modifier and TypeMethodDescription<T> void
addModel
(ExtraModelKey<T> key, UnbakedExtraModel<T> model) Add a model that will be loaded, baked, and made available throughFabricBakedModelManager.getModel(ExtraModelKey)
.Event access to replace the baked block model.Event access to replace the unbaked block model used for baking.Event access to monitor unbaked block model loads and replace the loaded model.Event access to replace the baked item model.Event access to replace the unbaked item model used for baking.Event access to monitor unbaked model loads and replace the loaded model.void
registerBlockStateResolver
(Block block, BlockStateResolver resolver) Registers a block state resolver for a block.
-
Method Details
-
registerBlockStateResolver
Registers a block state resolver for a block.The block must be registered and a block state resolver must not have been previously registered for the block.
-
addModel
Add a model that will be loaded, baked, and made available throughFabricBakedModelManager.getModel(ExtraModelKey)
.Dependency gathering and baking is performed by an
UnbakedExtraModel
. This allows you to depend on multiple models files at once, baking them into a single dynamic model. To load a single model, thenSimpleUnbakedExtraModel
may be used.- Type Parameters:
T
- The type of the baked model.- Parameters:
key
- The unique key for this model.model
- The "unbaked" model, responsible for loading dependencies and backing.- See Also:
-
modifyModelOnLoad
Event<ModelModifier.OnLoad> modifyModelOnLoad()Event access to monitor unbaked model loads and replace the loaded model.Replacements done by listeners of this callback affect child models (that is, models whose parent hierarchy contains the replaced model).
-
modifyBlockModelOnLoad
Event<ModelModifier.OnLoadBlock> modifyBlockModelOnLoad()Event access to monitor unbaked block model loads and replace the loaded model. -
modifyBlockModelBeforeBake
Event<ModelModifier.BeforeBakeBlock> modifyBlockModelBeforeBake()Event access to replace the unbaked block model used for baking. -
modifyBlockModelAfterBake
Event<ModelModifier.AfterBakeBlock> modifyBlockModelAfterBake()Event access to replace the baked block model. -
modifyItemModelBeforeBake
Event<ModelModifier.BeforeBakeItem> modifyItemModelBeforeBake()Event access to replace the unbaked item model used for baking. -
modifyItemModelAfterBake
Event<ModelModifier.AfterBakeItem> modifyItemModelAfterBake()Event access to replace the baked item model.
-