Class DelegateBlockStateModel

java.lang.Object
net.neoforged.neoforge.client.model.DelegateBlockStateModel
All Implemented Interfaces:
net.minecraft.client.renderer.block.model.BlockStateModel, BlockStateModelExtension
Direct Known Subclasses:
FullPotsAccessorDemo.ClientHandler.DioritePotModel, MegaModelTest.TransformingModelWrapper, TRSRTransformerTest.MyBakedModel

public abstract class DelegateBlockStateModel extends Object implements net.minecraft.client.renderer.block.model.BlockStateModel
A BlockStateModel that delegates all calls to another BlockStateModel.

There is one exception: the BlockStateModelExtension.createGeometryKey(net.minecraft.world.level.BlockAndTintGetter, net.minecraft.core.BlockPos, net.minecraft.world.level.block.state.BlockState, net.minecraft.util.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 net.minecraft.client.renderer.block.model.BlockStateModel

    net.minecraft.client.renderer.block.model.BlockStateModel.SimpleCachedUnbakedRoot, net.minecraft.client.renderer.block.model.BlockStateModel.Unbaked, net.minecraft.client.renderer.block.model.BlockStateModel.UnbakedRoot
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final net.minecraft.client.renderer.block.model.BlockStateModel
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    DelegateBlockStateModel(net.minecraft.client.renderer.block.model.BlockStateModel delegate)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    collectParts(net.minecraft.util.RandomSource random, List<net.minecraft.client.renderer.block.model.BlockModelPart> parts)
    Deprecated.
    void
    collectParts(net.minecraft.world.level.BlockAndTintGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.util.RandomSource random, List<net.minecraft.client.renderer.block.model.BlockModelPart> parts)
    Collects the parts of the model that should be rendered.
    net.minecraft.client.renderer.texture.TextureAtlasSprite
    Deprecated.
    net.minecraft.client.renderer.texture.TextureAtlasSprite
    particleIcon(net.minecraft.world.level.BlockAndTintGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
    Returns the particle icon.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.client.renderer.block.model.BlockStateModel

    collectParts

    Methods inherited from interface net.neoforged.neoforge.client.extensions.BlockStateModelExtension

    collectParts, createGeometryKey
  • Field Details

    • delegate

      protected final net.minecraft.client.renderer.block.model.BlockStateModel delegate
  • Constructor Details

    • DelegateBlockStateModel

      protected DelegateBlockStateModel(net.minecraft.client.renderer.block.model.BlockStateModel delegate)
  • Method Details

    • collectParts

      @Deprecated public void collectParts(net.minecraft.util.RandomSource random, List<net.minecraft.client.renderer.block.model.BlockModelPart> parts)
      Deprecated.
      Specified by:
      collectParts in interface net.minecraft.client.renderer.block.model.BlockStateModel
    • collectParts

      public void collectParts(net.minecraft.world.level.BlockAndTintGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.util.RandomSource random, List<net.minecraft.client.renderer.block.model.BlockModelPart> parts)
      Description copied from interface: BlockStateModelExtension
      Collects 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(net.minecraft.world.level.BlockAndTintGetter, net.minecraft.core.BlockPos, net.minecraft.core.Direction, net.minecraft.world.level.block.state.BlockState, net.minecraft.core.BlockPos) before accessing the block state is recommended.

      Specified by:
      collectParts in interface BlockStateModelExtension
      Parameters:
      level - a level to query block entity data or other world state
      pos - the position of the block being rendered
      state - the state of the block being rendered
      random - a random source for random model variations
      parts - the list that should receive all parts to be rendered
    • particleIcon

      @Deprecated public net.minecraft.client.renderer.texture.TextureAtlasSprite particleIcon()
      Deprecated.
      Specified by:
      particleIcon in interface net.minecraft.client.renderer.block.model.BlockStateModel
    • particleIcon

      public net.minecraft.client.renderer.texture.TextureAtlasSprite particleIcon(net.minecraft.world.level.BlockAndTintGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
      Description copied from interface: BlockStateModelExtension
      Returns the particle icon.

      Block entity data can be accessed using IBlockGetterExtension.getModelData(BlockPos).

      Specified by:
      particleIcon in interface BlockStateModelExtension