Class DelegateBlockStateModel
- All Implemented Interfaces:
BlockStateModel, BlockStateModelExtension
BlockStateModel that delegates all calls to another BlockStateModel.
There is one exception: the BlockStateModelExtension.createGeometryKey(BlockAndTintGetter, BlockPos, BlockState, RandomSource) method, which is not delegated.
The default implementation of this method returns null,
meaning that the geometry of the delegate model cannot be cached using the key.
-
Nested Class Summary
Nested classes/interfaces inherited from interface BlockStateModel
BlockStateModel.SimpleCachedUnbakedRoot, BlockStateModel.Unbaked, BlockStateModel.UnbakedRoot -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcollectParts(RandomSource random, List<BlockModelPart> parts) Deprecated.voidcollectParts(BlockAndTintGetter level, BlockPos pos, BlockState state, RandomSource random, List<BlockModelPart> parts) Collects the parts of the model that should be rendered.booleanDeprecated.booleanhasTranslucency(BlockAndTintGetter level, BlockPos pos, BlockState state) Returns whether this model contains any translucent quads.Deprecated.particleMaterial(BlockAndTintGetter level, BlockPos pos, BlockState state) Returns the particle icon.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BlockStateModel
collectPartsMethods inherited from interface BlockStateModelExtension
collectParts, createGeometryKey
-
Field Details
-
delegate
-
-
Constructor Details
-
DelegateBlockStateModel
-
-
Method Details
-
collectParts
Deprecated.- Specified by:
collectPartsin interfaceBlockStateModel
-
collectParts
public void collectParts(BlockAndTintGetter level, BlockPos pos, BlockState state, RandomSource random, List<BlockModelPart> parts) Description copied from interface:BlockStateModelExtensionCollects the parts of the model that should be rendered.Typically called on a meshing worker thread, with a snapshot of world state. To access block entity data, use
IBlockGetterExtension.getModelData(BlockPos)on the passed level. Avoid accessing or manipulating the block entities directly as they are not thread safe. Other world state is safe to access.The parameters passed to this method might not be what the model expects. For example, the model data might be missing or coming from a different/outdated block entity, the block state in the level might be different from the one passed in, and so on... The model should handle these cases gracefully and return the best model it can (e.g. by returning a completely unconnected model, in the case of connected textures).
Calling
IBlockStateExtension.getAppearance(BlockAndTintGetter, BlockPos, Direction, BlockState, BlockPos)before accessing the block state is recommended.- Specified by:
collectPartsin interfaceBlockStateModelExtension- Parameters:
level- a level to query block entity data or other world statepos- the position of the block being renderedstate- the state of the block being renderedrandom- a random source for random model variationsparts- the list that should receive all parts to be rendered
-
particleMaterial
Deprecated.- Specified by:
particleMaterialin interfaceBlockStateModel
-
particleMaterial
Description copied from interface:BlockStateModelExtensionReturns the particle icon.Block entity data can be accessed using
IBlockGetterExtension.getModelData(BlockPos).- Specified by:
particleMaterialin interfaceBlockStateModelExtension
-
hasTranslucency
Deprecated.- Specified by:
hasTranslucencyin interfaceBlockStateModel
-
hasTranslucency
Description copied from interface:BlockStateModelExtensionReturns whether this model contains any translucent quads.- Specified by:
hasTranslucencyin interfaceBlockStateModelExtension- Parameters:
level- a level to query block entity data or other world statepos- the position of the block being renderedstate- the state of the block being rendered
-