Class ModelModifier
java.lang.Object
net.fabricmc.fabric.api.client.model.loading.v1.ModelModifier
Contains interfaces for the events that can be used to modify models at different points in the loading and baking
process.
Example use cases:
- Overriding a model for a particular block state - check if the given identifier is a
ModelIdentifier
, and then check if it has the appropriate variant for that block state. If so, return your desired model, otherwise return the given model. - Wrapping a model to override certain behaviors - simply return a new model instance and delegate calls to the original model as needed.
Phases are used to ensure that modifications occur in a reasonable order, e.g. wrapping occurs after overrides, and separate phases are provided for mods that wrap their own models and mods that need to wrap models of other mods or wrap models arbitrarily.
These callbacks are invoked for every single model that is loaded or baked, so implementations should be as efficient as possible.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
static interface
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Identifier
Recommended phase to use for transformations that need to happen before wrapping, but after model overrides.static final Identifier
Recommended phase to use when overriding models, e.g.static final Identifier
Recommended phase to use when wrapping models with transformations that want to happen last, e.g.static final Identifier
Recommended phase to use when wrapping models. -
Method Summary
-
Field Details
-
OVERRIDE_PHASE
Recommended phase to use when overriding models, e.g. replacing a model with another model. -
DEFAULT_PHASE
Recommended phase to use for transformations that need to happen before wrapping, but after model overrides. -
WRAP_PHASE
Recommended phase to use when wrapping models. -
WRAP_LAST_PHASE
Recommended phase to use when wrapping models with transformations that want to happen last, e.g. for connected textures or other similar visual effects that should be the final processing step.
-