Interface BlockStateResolver.Context
- Enclosing interface:
BlockStateResolver
@NonExtendable
public static interface BlockStateResolver.Context
The context for block state resolution.
-
Method Summary
Modifier and TypeMethodDescriptionblock()
The block for which block state models are being resolved.Loads a model using anIdentifier
orModelIdentifier
, or gets it if it was already loaded.loader()
The current model loader instance, which changes between resource reloads.void
setModel
(BlockState state, UnbakedModel model) Sets the model for a block state.
-
Method Details
-
block
Block block()The block for which block state models are being resolved. -
setModel
Sets the model for a block state.- Parameters:
state
- the block state for which this model should be usedmodel
- the unbaked model for this block state
-
getOrLoadModel
Loads a model using anIdentifier
orModelIdentifier
, 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.Do not call
ModelLoader.getOrLoadModel(net.minecraft.util.Identifier)
as it does not supported nested model resolution; usegetOrLoadModel(net.minecraft.util.Identifier)
from the context instead.
-