Interface FabricModelBlockRenderer


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

    Modifier and Type
    Method
    Description
    static void
    render(com.mojang.blaze3d.vertex.PoseStack.Pose pose, BlockMultiBufferSource bufferSource, net.minecraft.client.renderer.block.model.BlockStateModel model, float red, float green, float blue, int light, int overlay, net.minecraft.world.level.BlockAndTintGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
    Alternative for ModelBlockRenderer.renderModel(PoseStack.Pose, VertexConsumer, BlockStateModel, float, float, float, int, int) that accepts a BlockMultiBufferSource instead of a VertexConsumer.
    default void
    render(net.minecraft.world.level.BlockAndTintGetter level, net.minecraft.client.renderer.block.model.BlockStateModel model, net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos, com.mojang.blaze3d.vertex.PoseStack poseStack, BlockMultiBufferSource bufferSource, boolean cull, long seed, int overlay)
    Alternative for ModelBlockRenderer.tesselateBlock(BlockAndTintGetter, List, BlockState, BlockPos, PoseStack, VertexConsumer, boolean, int) and BlockRenderDispatcher.renderBatched(BlockState, BlockPos, BlockAndTintGetter, PoseStack, VertexConsumer, boolean, List) that accepts a BlockStateModel instead of a List<BlockModelPart> and a BlockMultiBufferSource instead of a VertexConsumer.
  • Method Details

    • render

      default void render(net.minecraft.world.level.BlockAndTintGetter level, net.minecraft.client.renderer.block.model.BlockStateModel model, net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos, com.mojang.blaze3d.vertex.PoseStack poseStack, BlockMultiBufferSource bufferSource, boolean cull, long seed, int overlay)
      Alternative for ModelBlockRenderer.tesselateBlock(BlockAndTintGetter, List, BlockState, BlockPos, PoseStack, VertexConsumer, boolean, int) and BlockRenderDispatcher.renderBatched(BlockState, BlockPos, BlockAndTintGetter, PoseStack, VertexConsumer, boolean, List) that accepts a BlockStateModel instead of a List<BlockModelPart> and a BlockMultiBufferSource instead of a VertexConsumer. Also accepts the random seed. Prefer using this method over the vanilla alternative to correctly retrieve geometry from models that implement FabricBlockStateModel.emitQuads(QuadEmitter, BlockAndTintGetter, BlockPos, BlockState, RandomSource, Predicate) and to correctly buffer models that have geometry on multiple chunk layers.

      This method allows buffering a block model in a terrain-like context, which usually includes stages like culling, dynamic tinting, shading, and flat/smooth lighting.

      Parameters:
      level - The level in which to render the model. Should not be empty (i.e. not EmptyBlockAndTintGetter).
      model - The model to render.
      state - The block state.
      pos - The position of the block in the level.
      poseStack - The pose stack.
      bufferSource - The buffer source.
      cull - Whether to try to cull faces hidden by other blocks.
      seed - The random seed. Usually retrieved by the caller from BlockBehaviour.BlockStateBase.getSeed(BlockPos).
      overlay - The overlay value to pass to output VertexConsumers.
    • render

      static void render(com.mojang.blaze3d.vertex.PoseStack.Pose pose, BlockMultiBufferSource bufferSource, net.minecraft.client.renderer.block.model.BlockStateModel model, float red, float green, float blue, int light, int overlay, net.minecraft.world.level.BlockAndTintGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
      Alternative for ModelBlockRenderer.renderModel(PoseStack.Pose, VertexConsumer, BlockStateModel, float, float, float, int, int) that accepts a BlockMultiBufferSource instead of a VertexConsumer. Also accepts the BlockAndTintGetter, BlockPos, and BlockState to pass to FabricBlockStateModel.emitQuads(QuadEmitter, BlockAndTintGetter, BlockPos, BlockState, RandomSource, Predicate) when necessary. Prefer using this method over the vanilla alternative to correctly buffer models that have geometry on multiple chunk layers and to provide the model with additional context.

      This method allows buffering a block model with minimal transformations to the model geometry. Usually used by entity renderers.

      Parameters:
      pose - The pose.
      bufferSource - The buffer source.
      model - The model to render.
      red - The red component of the tint color.
      green - The green component of the tint color.
      blue - The blue component of the tint color.
      light - The minimum light value.
      overlay - The overlay value.
      level - The level in which to render the model. Can be empty (i.e. EmptyBlockAndTintGetter).
      pos - The position of the block in the level. Should be BlockPos.ZERO if the level is empty.
      state - The block state. Should be Blocks.AIR.getDefaultState() if not applicable.
      See Also: