Interface ICCBlockRenderer


public interface ICCBlockRenderer
Capable of rendering Blocks and Fluids directly to the chunk buffer.

Created by covers1624 on 8/09/2016.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canHandleBlock(net.minecraft.world.level.BlockAndTintGetter world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState blockState, @Nullable net.minecraft.client.renderer.RenderType renderType)
    Called to evaluate weather this ICCBlockRenderer will be called for the specified BlockState.
    default boolean
    canHandleEntity(net.minecraft.world.level.block.state.BlockState state)
    default boolean
    canHandleFluid(net.minecraft.world.level.BlockAndTintGetter world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.level.material.FluidState fluidState)
    Called to evaluate weather this ICCBlockRenderer will be called for the specified IFluidState.
    void
    renderBlock(net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos, net.minecraft.world.level.BlockAndTintGetter world, com.mojang.blaze3d.vertex.PoseStack mStack, com.mojang.blaze3d.vertex.VertexConsumer builder, net.minecraft.util.RandomSource random, net.minecraftforge.client.model.data.ModelData data, @Nullable net.minecraft.client.renderer.RenderType renderType)
    Called to render your block in world.
    default void
    renderBreaking(net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos, net.minecraft.world.level.BlockAndTintGetter world, com.mojang.blaze3d.vertex.PoseStack mStack, com.mojang.blaze3d.vertex.VertexConsumer builder, net.minecraftforge.client.model.data.ModelData data)
    Called when vanilla is rendering breaking texture over your block.
    default void
    renderEntity(net.minecraft.world.level.block.state.BlockState state, com.mojang.blaze3d.vertex.PoseStack nStack, net.minecraft.client.renderer.MultiBufferSource builder, int packedLight, int packedOverlay, net.minecraftforge.client.model.data.ModelData data, @Nullable net.minecraft.client.renderer.RenderType renderType)
    Called for misc entities holding or have blocks as part of their model.
    default void
    renderFluid(net.minecraft.core.BlockPos pos, net.minecraft.world.level.BlockAndTintGetter world, com.mojang.blaze3d.vertex.VertexConsumer builder, net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.level.material.FluidState fluidState)
    Called to render your fluid in world.
  • Method Details

    • canHandleBlock

      boolean canHandleBlock(net.minecraft.world.level.BlockAndTintGetter world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState blockState, @Nullable @Nullable net.minecraft.client.renderer.RenderType renderType)
      Called to evaluate weather this ICCBlockRenderer will be called for the specified BlockState.
      Parameters:
      world - The world.
      pos - The pos.
      blockState - The BlockState.
      renderType - The RenderType, null for breaking.
      Returns:
      If you wish to render the BlockState.
    • renderBlock

      void renderBlock(net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos, net.minecraft.world.level.BlockAndTintGetter world, com.mojang.blaze3d.vertex.PoseStack mStack, com.mojang.blaze3d.vertex.VertexConsumer builder, net.minecraft.util.RandomSource random, net.minecraftforge.client.model.data.ModelData data, @Nullable @Nullable net.minecraft.client.renderer.RenderType renderType)
      Called to render your block in world. You MUST use the provided VertexConsumer. THE BUFFER IS ALREADY DRAWING! YOU MAY BE FIRED ON THE CHUNK BATCHING THREAD!
      Parameters:
      state - Your state.
      pos - Position.
      world - World.
      mStack - The PoseStack.
      builder - The VertexConsumer to add quads to.
      random - Position seeded Random for this block position.
      data - Any ModelData.
      renderType - The RenderType, null for breaking.
    • renderBreaking

      default void renderBreaking(net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos, net.minecraft.world.level.BlockAndTintGetter world, com.mojang.blaze3d.vertex.PoseStack mStack, com.mojang.blaze3d.vertex.VertexConsumer builder, net.minecraftforge.client.model.data.ModelData data)
      Called when vanilla is rendering breaking texture over your block. Usually just render out your normal quads.
      Parameters:
      state - Your state.
      pos - Position.
      world - World.
      mStack - The PoseStack.
      builder - The VertexConsumer to add quads to.
      data - Any ModelData.
    • canHandleEntity

      default boolean canHandleEntity(net.minecraft.world.level.block.state.BlockState state)
      Parameters:
      state - The state.
      Returns:
      If you wish to render this block.
    • renderEntity

      default void renderEntity(net.minecraft.world.level.block.state.BlockState state, com.mojang.blaze3d.vertex.PoseStack nStack, net.minecraft.client.renderer.MultiBufferSource builder, int packedLight, int packedOverlay, net.minecraftforge.client.model.data.ModelData data, @Nullable @Nullable net.minecraft.client.renderer.RenderType renderType)
      Called for misc entities holding or have blocks as part of their model. IronGolems, Enderman, Mooshroom, Minecarts, TNT.
      Parameters:
      state - The BlockState to render.
      nStack - The PoseStack.
      builder - The MultiBufferSource
      packedLight - The LightTexture packed coords.
      packedOverlay - The OverlayTexture packed coords.
      data - Any ModelData.
      renderType - The RenderType may be null.
    • canHandleFluid

      default boolean canHandleFluid(net.minecraft.world.level.BlockAndTintGetter world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.level.material.FluidState fluidState)
      Called to evaluate weather this ICCBlockRenderer will be called for the specified IFluidState.
      Parameters:
      world - The world.
      pos - The pos.
      blockState - The BlockState
      fluidState - The FluidState.
      Returns:
      If you wish to render the FluidState.
    • renderFluid

      default void renderFluid(net.minecraft.core.BlockPos pos, net.minecraft.world.level.BlockAndTintGetter world, com.mojang.blaze3d.vertex.VertexConsumer builder, net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.level.material.FluidState fluidState)
      Called to render your fluid in world. You MUST use the provided VertexConsumer. THE BUFFER IS ALREADY DRAWING! YOU MAY BE FIRED ON THE CHUNK BATCHING THREAD!
      Parameters:
      pos - Position.
      world - World.
      builder - The VertexConsumer.
      blockState - The BlockState
      fluidState - The FluidState