当前位置: 首页>>代码示例>>Java>>正文


Java Block.getMixedBrightnessForBlock方法代码示例

本文整理汇总了Java中net.minecraft.block.Block.getMixedBrightnessForBlock方法的典型用法代码示例。如果您正苦于以下问题:Java Block.getMixedBrightnessForBlock方法的具体用法?Java Block.getMixedBrightnessForBlock怎么用?Java Block.getMixedBrightnessForBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.block.Block的用法示例。


在下文中一共展示了Block.getMixedBrightnessForBlock方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setBrightness

import net.minecraft.block.Block; //导入方法依赖的package包/类
private int setBrightness(Tessellator tessellator, IBlockAccess blockAccess, int x, int y, int z, Block block) {
	int mb = block.getMixedBrightnessForBlock(blockAccess, x, y, z);
	tessellator.setBrightness(mb);

	float f = 1.0F;

	int l = block.colorMultiplier(blockAccess, x, y, z);
	float f1 = (l >> 16 & 0xFF) / 255.0F;
	float f2 = (l >> 8 & 0xFF) / 255.0F;
	float f3 = (l & 0xFF) / 255.0F;
	if (EntityRenderer.anaglyphEnable) {
		float f6 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F;
		float f4 = (f1 * 30.0F + f2 * 70.0F) / 100.0F;
		float f7 = (f1 * 30.0F + f3 * 70.0F) / 100.0F;
		f1 = f6;
		f2 = f4;
		f3 = f7;
	}
	tessellator.setColorOpaque_F(f * f1, f * f2, f * f3);
	return mb;
}
 
开发者ID:MJaroslav,项目名称:ThaumOres,代码行数:22,代码来源:TileInfusedBlockOreRenderer.java

示例2: renderModelStandard

import net.minecraft.block.Block; //导入方法依赖的package包/类
public boolean renderModelStandard(IBlockAccess blockAccessIn, IBakedModel modelIn, Block blockIn, BlockPos blockPosIn, WorldRenderer worldRendererIn, boolean checkSides)
{
    boolean flag = false;
    BitSet bitset = new BitSet(3);

    for (EnumFacing enumfacing : EnumFacing.values())
    {
        List<BakedQuad> list = modelIn.getFaceQuads(enumfacing);

        if (!list.isEmpty())
        {
            BlockPos blockpos = blockPosIn.offset(enumfacing);

            if (!checkSides || blockIn.shouldSideBeRendered(blockAccessIn, blockpos, enumfacing))
            {
                int i = blockIn.getMixedBrightnessForBlock(blockAccessIn, blockpos);
                this.renderModelStandardQuads(blockAccessIn, blockIn, blockPosIn, enumfacing, i, false, worldRendererIn, list, bitset);
                flag = true;
            }
        }
    }

    List<BakedQuad> list1 = modelIn.getGeneralQuads();

    if (list1.size() > 0)
    {
        this.renderModelStandardQuads(blockAccessIn, blockIn, blockPosIn, (EnumFacing)null, -1, true, worldRendererIn, list1, bitset);
        flag = true;
    }

    return flag;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:33,代码来源:BlockModelRenderer.java

示例3: renderModelStandardQuads

import net.minecraft.block.Block; //导入方法依赖的package包/类
private void renderModelStandardQuads(IBlockAccess blockAccessIn, Block blockIn, BlockPos blockPosIn, EnumFacing faceIn, int brightnessIn, boolean ownBrightness, WorldRenderer worldRendererIn, List<BakedQuad> listQuadsIn, BitSet boundsFlags)
{
    double d0 = (double)blockPosIn.getX();
    double d1 = (double)blockPosIn.getY();
    double d2 = (double)blockPosIn.getZ();
    Block.EnumOffsetType block$enumoffsettype = blockIn.getOffsetType();

    if (block$enumoffsettype != Block.EnumOffsetType.NONE)
    {
        int i = blockPosIn.getX();
        int j = blockPosIn.getZ();
        long k = (long)(i * 3129871) ^ (long)j * 116129781L;
        k = k * k * 42317861L + k * 11L;
        d0 += ((double)((float)(k >> 16 & 15L) / 15.0F) - 0.5D) * 0.5D;
        d2 += ((double)((float)(k >> 24 & 15L) / 15.0F) - 0.5D) * 0.5D;

        if (block$enumoffsettype == Block.EnumOffsetType.XYZ)
        {
            d1 += ((double)((float)(k >> 20 & 15L) / 15.0F) - 1.0D) * 0.2D;
        }
    }

    for (BakedQuad bakedquad : listQuadsIn)
    {
        if (ownBrightness)
        {
            this.fillQuadBounds(blockIn, bakedquad.getVertexData(), bakedquad.getFace(), (float[])null, boundsFlags);
            brightnessIn = boundsFlags.get(0) ? blockIn.getMixedBrightnessForBlock(blockAccessIn, blockPosIn.offset(bakedquad.getFace())) : blockIn.getMixedBrightnessForBlock(blockAccessIn, blockPosIn);
        }

        worldRendererIn.addVertexData(bakedquad.getVertexData());
        worldRendererIn.putBrightness4(brightnessIn, brightnessIn, brightnessIn, brightnessIn);

        if (bakedquad.hasTintIndex())
        {
            int l = blockIn.colorMultiplier(blockAccessIn, blockPosIn, bakedquad.getTintIndex());

            if (EntityRenderer.anaglyphEnable)
            {
                l = TextureUtil.anaglyphColor(l);
            }

            float f = (float)(l >> 16 & 255) / 255.0F;
            float f1 = (float)(l >> 8 & 255) / 255.0F;
            float f2 = (float)(l & 255) / 255.0F;
            worldRendererIn.putColorMultiplier(f, f1, f2, 4);
            worldRendererIn.putColorMultiplier(f, f1, f2, 3);
            worldRendererIn.putColorMultiplier(f, f1, f2, 2);
            worldRendererIn.putColorMultiplier(f, f1, f2, 1);
        }

        worldRendererIn.putPosition(d0, d1, d2);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:55,代码来源:BlockModelRenderer.java

示例4: renderModelStandard

import net.minecraft.block.Block; //导入方法依赖的package包/类
public boolean renderModelStandard(IBlockAccess p_renderModelStandard_1_, IBakedModel p_renderModelStandard_2_, Block p_renderModelStandard_3_, IBlockState p_renderModelStandard_4_, BlockPos p_renderModelStandard_5_, WorldRenderer p_renderModelStandard_6_, boolean p_renderModelStandard_7_)
{
    boolean flag = false;
    RenderEnv renderenv = null;

    for (EnumFacing enumfacing : EnumFacing.VALUES)
    {
        List list = p_renderModelStandard_2_.getFaceQuads(enumfacing);

        if (!list.isEmpty())
        {
            BlockPos blockpos = p_renderModelStandard_5_.offset(enumfacing);

            if (!p_renderModelStandard_7_ || p_renderModelStandard_3_.shouldSideBeRendered(p_renderModelStandard_1_, blockpos, enumfacing))
            {
                if (renderenv == null)
                {
                    renderenv = RenderEnv.getInstance(p_renderModelStandard_1_, p_renderModelStandard_4_, p_renderModelStandard_5_);
                }

                if (!renderenv.isBreakingAnimation(list) && Config.isBetterGrass())
                {
                    list = BetterGrass.getFaceQuads(p_renderModelStandard_1_, p_renderModelStandard_3_, p_renderModelStandard_5_, enumfacing, list);
                }

                int i = p_renderModelStandard_3_.getMixedBrightnessForBlock(p_renderModelStandard_1_, blockpos);
                this.renderModelStandardQuads(p_renderModelStandard_1_, p_renderModelStandard_3_, p_renderModelStandard_5_, enumfacing, i, false, p_renderModelStandard_6_, list, renderenv);
                flag = true;
            }
        }
    }

    List list1 = p_renderModelStandard_2_.getGeneralQuads();

    if (list1.size() > 0)
    {
        if (renderenv == null)
        {
            renderenv = RenderEnv.getInstance(p_renderModelStandard_1_, p_renderModelStandard_4_, p_renderModelStandard_5_);
        }

        this.renderModelStandardQuads(p_renderModelStandard_1_, p_renderModelStandard_3_, p_renderModelStandard_5_, (EnumFacing)null, -1, true, p_renderModelStandard_6_, list1, renderenv);
        flag = true;
    }

    if (renderenv != null && Config.isBetterSnow() && !renderenv.isBreakingAnimation() && BetterSnow.shouldRender(p_renderModelStandard_1_, p_renderModelStandard_3_, p_renderModelStandard_4_, p_renderModelStandard_5_) && BetterSnow.shouldRender(p_renderModelStandard_1_, p_renderModelStandard_3_, p_renderModelStandard_4_, p_renderModelStandard_5_))
    {
        IBakedModel ibakedmodel = BetterSnow.getModelSnowLayer();
        IBlockState iblockstate = BetterSnow.getStateSnowLayer();
        this.renderModelStandard(p_renderModelStandard_1_, ibakedmodel, iblockstate.getBlock(), iblockstate, p_renderModelStandard_5_, p_renderModelStandard_6_, true);
    }

    return flag;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:55,代码来源:BlockModelRenderer.java

示例5: renderWorldBlock

import net.minecraft.block.Block; //导入方法依赖的package包/类
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
	Tessellator tessellator = Tessellator.instance;
	int meta = world.getBlockMetadata(x, y, z);

	if ((meta & 8) != 0) {
		if (world.getBlock(x, y - 1, z) != block)
			return false;
	} else if (world.getBlock(x, y + 1, z) != block)
		return false;

	int brightness = block.getMixedBrightnessForBlock(world, x, y, z);

	tessellator.setBrightness(renderer.renderMinY > 0.0D ? brightness : block.getMixedBrightnessForBlock(world, x, y - 1, z));
	tessellator.setColorOpaque_F(0.5F, 0.5F, 0.5F);
	renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 0));

	if ((meta & 8) != 0) {
		tessellator.setBrightness(renderer.renderMaxY < 1.0D ? brightness : block.getMixedBrightnessForBlock(world, x, y + 1, z));
		tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F);
		renderer.uvRotateTop = 2;
		renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 1));
		renderer.uvRotateTop = 0;
	}

	tessellator.setBrightness(renderer.renderMinZ > 0.0D ? brightness : block.getMixedBrightnessForBlock(world, x, y, z - 1));
	tessellator.setColorOpaque_F(0.8F, 0.8F, 0.8F);
	renderer.renderFaceZNeg(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 2));

	renderer.flipTexture = false;
	tessellator.setBrightness(renderer.renderMaxZ < 1.0D ? brightness : block.getMixedBrightnessForBlock(world, x, y, z + 1));
	tessellator.setColorOpaque_F(0.8F, 0.8F, 0.8F);
	renderer.renderFaceZPos(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 3));

	renderer.flipTexture = false;
	tessellator.setBrightness(renderer.renderMinX > 0.0D ? brightness : block.getMixedBrightnessForBlock(world, x - 1, y, z));
	tessellator.setColorOpaque_F(0.6F, 0.6F, 0.6F);
	renderer.renderFaceXNeg(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 4));

	renderer.flipTexture = false;
	tessellator.setBrightness(renderer.renderMaxX < 1.0D ? brightness : block.getMixedBrightnessForBlock(world, x + 1, y, z));
	tessellator.setColorOpaque_F(0.6F, 0.6F, 0.6F);
	renderer.renderFaceXPos(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 5));

	renderer.flipTexture = false;
	return true;
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:48,代码来源:BlockDoorRenderer.java


注:本文中的net.minecraft.block.Block.getMixedBrightnessForBlock方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。