Search in sources :

Example 1 with BlockRenderType

use of net.minecraft.block.BlockRenderType in project AstralSorcery by HellFirePvP.

the class RenderingUtils method renderSimpleBlockModelCurrentWorld.

public static void renderSimpleBlockModelCurrentWorld(BlockState state, MatrixStack renderStack, IVertexBuilder buf, BlockPos pos, @Nullable TileEntity te, int combinedOverlayIn, boolean checkRenderSide) {
    BlockRenderType brt = state.getRenderType();
    if (brt == BlockRenderType.INVISIBLE) {
        return;
    }
    BlockRendererDispatcher brd = Minecraft.getInstance().getBlockRendererDispatcher();
    IModelData data = EmptyModelData.INSTANCE;
    if (te != null) {
        data = te.getModelData();
    }
    if (brt == BlockRenderType.MODEL) {
        IBakedModel model = brd.getModelForState(state);
        brd.getBlockModelRenderer().renderModel(Minecraft.getInstance().world, model, state, pos, renderStack, buf, checkRenderSide, rand, state.getPositionRandom(pos), combinedOverlayIn, data);
    }
}
Also used : BlockRenderType(net.minecraft.block.BlockRenderType) IBakedModel(net.minecraft.client.renderer.model.IBakedModel) IModelData(net.minecraftforge.client.model.data.IModelData)

Example 2 with BlockRenderType

use of net.minecraft.block.BlockRenderType in project AstralSorcery by HellFirePvP.

the class RenderingUtils method renderSimpleBlockModel.

public static void renderSimpleBlockModel(BlockState state, MatrixStack renderStack, IVertexBuilder vb, BlockPos pos, @Nullable TileEntity te, boolean checkRenderSide) {
    if (plainRenderWorld == null) {
        plainRenderWorld = new EmptyRenderWorld(() -> RegistryUtil.client().getValue(Registry.BIOME_KEY, Biomes.PLAINS));
    }
    BlockRenderType brt = state.getRenderType();
    if (brt == BlockRenderType.INVISIBLE) {
        return;
    }
    BlockRendererDispatcher brd = Minecraft.getInstance().getBlockRendererDispatcher();
    IModelData data = EmptyModelData.INSTANCE;
    if (te != null) {
        data = te.getModelData();
    }
    brd.renderModel(state, pos, plainRenderWorld, renderStack, vb, checkRenderSide, rand, data);
}
Also used : BlockRenderType(net.minecraft.block.BlockRenderType) IModelData(net.minecraftforge.client.model.data.IModelData)

Aggregations

BlockRenderType (net.minecraft.block.BlockRenderType)2 IModelData (net.minecraftforge.client.model.data.IModelData)2 IBakedModel (net.minecraft.client.renderer.model.IBakedModel)1