Package codechicken.lib.render.block
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 TypeMethodDescriptionbooleancanHandleBlock(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 booleancanHandleEntity(net.minecraft.world.level.block.state.BlockState state) Called to evaluate weather this ICCBlockRenderer will be called to handlerenderEntity(net.minecraft.world.level.block.state.BlockState, com.mojang.blaze3d.vertex.PoseStack, net.minecraft.client.renderer.MultiBufferSource, int, int, net.minecraftforge.client.model.data.ModelData, net.minecraft.client.renderer.RenderType)for the given BlockState.default booleancanHandleFluid(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.voidrenderBlock(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 voidrenderBreaking(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 voidrenderEntity(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 voidrenderFluid(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- TheRenderType,nullfor 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 providedVertexConsumer. THE BUFFER IS ALREADY DRAWING! YOU MAY BE FIRED ON THE CHUNK BATCHING THREAD!- Parameters:
state- Your state.pos- Position.world- World.mStack- ThePoseStack.builder- TheVertexConsumerto add quads to.random- Position seeded Random for this block position.data- Any ModelData.renderType- TheRenderType,nullfor 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- ThePoseStack.builder- TheVertexConsumerto add quads to.data- Any ModelData.
-
canHandleEntity
default boolean canHandleEntity(net.minecraft.world.level.block.state.BlockState state) Called to evaluate weather this ICCBlockRenderer will be called to handlerenderEntity(net.minecraft.world.level.block.state.BlockState, com.mojang.blaze3d.vertex.PoseStack, net.minecraft.client.renderer.MultiBufferSource, int, int, net.minecraftforge.client.model.data.ModelData, net.minecraft.client.renderer.RenderType)for the given BlockState.- 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- ThePoseStack.builder- TheMultiBufferSourcepackedLight- TheLightTexturepacked coords.packedOverlay- TheOverlayTexturepacked coords.data- Any ModelData.renderType- TheRenderTypemay benull.
-
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- TheBlockStatefluidState- TheFluidState.- 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 providedVertexConsumer. THE BUFFER IS ALREADY DRAWING! YOU MAY BE FIRED ON THE CHUNK BATCHING THREAD!- Parameters:
pos- Position.world- World.builder- TheVertexConsumer.blockState- TheBlockStatefluidState- TheFluidState
-