Interface FabricBlockModels


public interface FabricBlockModels
Note: This interface is automatically implemented on BlockModelShaper via Mixin and interface injection.
  • Method Summary

    Modifier and Type
    Method
    Description
    default net.minecraft.client.renderer.texture.TextureAtlasSprite
    getModelParticleSprite(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockAndTintGetter blockView, net.minecraft.core.BlockPos pos)
    Alternative for BlockModelShaper.getParticleIcon(BlockState) that additionally accepts a BlockAndTintGetter and BlockPos to invoke FabricBlockStateModel.particleSprite(BlockAndTintGetter, BlockPos, BlockState).
  • Method Details

    • getModelParticleSprite

      default net.minecraft.client.renderer.texture.TextureAtlasSprite getModelParticleSprite(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockAndTintGetter blockView, net.minecraft.core.BlockPos pos)
      Alternative for BlockModelShaper.getParticleIcon(BlockState) that additionally accepts a BlockAndTintGetter and BlockPos to invoke FabricBlockStateModel.particleSprite(BlockAndTintGetter, BlockPos, BlockState). Prefer using this method over the vanilla alternative when applicable to correctly retrieve context-aware particle sprites. If world context is not available, use the vanilla method instead of passing empty world context to this method.
      Parameters:
      state - The block state whose model to retrieve the particle sprite from.
      blockView - The world in which the block exists. Should not be empty (i.e. not EmptyBlockAndTintGetter).
      pos - The position of the block in the world.
      Returns:
      the particle sprite