Interface BlockStateResolver
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Block state resolvers are responsible for mapping each
BlockState
of a block to a GroupableModel
.
They replace the blockstates/
JSON files. One block can be mapped to only one block state resolver; multiple
resolvers will not receive the same block.
Block state resolvers can be used to create custom block state formats or dynamically resolve block state models.
Use ModelModifier.OnLoad
instead of this interface if interacting with the block and block states directly
is not necessary. This includes custom model deserializers and loaders.
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
The context for block state resolution. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Resolves the models for all block states of the block.
-
Method Details
-
resolveBlockStates
Resolves the models for all block states of the block.For each block state, call
BlockStateResolver.Context.setModel(net.minecraft.block.BlockState, net.minecraft.client.render.model.GroupableModel)
to set its unbaked model. This method must be called exactly once for each block state.Note that if multiple block states share the same unbaked model instance, it will be baked multiple times (once per block state that has the model set).
-