Java Code Examples for net.minecraft.client.renderer.EntityRenderer#anaglyphEnable()

The following examples show how to use net.minecraft.client.renderer.EntityRenderer#anaglyphEnable() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FacadeRenderer.java    From GregTech with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static List<CCQuad> applyItemTint(List<CCQuad> quads, ItemStack stack) {
    List<CCQuad> retQuads = new LinkedList<>();
    for (CCQuad quad : quads) {
        int colour = -1;

        if (quad.hasTint()) {
            colour = Minecraft.getMinecraft().getItemColors().colorMultiplier(stack, quad.tintIndex);

            if (EntityRenderer.anaglyphEnable) {
                colour = TextureUtil.anaglyphColor(colour);
            }
            colour = colour | 0xFF000000;
        }
        CCQuad copyQuad = quad.copy();

        Colour c = new ColourARGB(colour);
        for (Colour qC : copyQuad.colours) {
            qC.multiply(c);
        }
        retQuads.add(copyQuad);
    }

    return retQuads;
}
 
Example 2
Source File: BlockExtendedNodeJarRenderer.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
private int setBrightness(IBlockAccess blockAccess, int i, int j, int k, Block block) {
    Tessellator tessellator = Tessellator.instance;
    int mb = block.getMixedBrightnessForBlock(blockAccess, i, j, k);
    tessellator.setBrightness(mb);

    float f = 1.0F;

    int l = block.colorMultiplier(blockAccess, i, j, k);
    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;
}
 
Example 3
Source File: RenderHelper.java    From GardenCollection with MIT License 6 votes vote down vote up
public static void calculateBaseColor (float[] target, int color) {
    float r = (float)(color >> 16 & 255) / 255f;
    float g = (float)(color >> 8 & 255) / 255f;
    float b = (float)(color & 255) / 255f;

    if (EntityRenderer.anaglyphEnable) {
        float gray = (r * 30f + g * 59f + b * 11f) / 100f;
        float rg = (r * 30f + g * 70f) / 100f;
        float rb = (r * 30f + b * 70f) / 100f;

        r = gray;
        g = rg;
        b = rb;
    }

    target[0] = r;
    target[1] = g;
    target[2] = b;
}
 
Example 4
Source File: HeavyChainRenderer.java    From GardenCollection with MIT License 6 votes vote down vote up
private void renderCrossedSquares (RenderBlocks renderer, Block block, int x, int y, int z)
{
    Tessellator tessellator = Tessellator.instance;
    tessellator.setBrightness(block.getMixedBrightnessForBlock(renderer.blockAccess, x, y, z));
    int l = block.colorMultiplier(renderer.blockAccess, x, y, z);
    float f = (float)(l >> 16 & 255) / 255.0F;
    float f1 = (float)(l >> 8 & 255) / 255.0F;
    float f2 = (float)(l & 255) / 255.0F;

    if (EntityRenderer.anaglyphEnable)
    {
        float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F;
        float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F;
        float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F;
        f = f3;
        f1 = f4;
        f2 = f5;
    }

    tessellator.setColorOpaque_F(f, f1, f2);

    IIcon iicon = renderer.getBlockIconFromSideAndMetadata(block, 0, renderer.blockAccess.getBlockMetadata(x, y, z));
    drawCrossedSquares(renderer, iicon, x, y, z, 1.0F);
}
 
Example 5
Source File: GardenProxyRenderer.java    From GardenCollection with MIT License 5 votes vote down vote up
private boolean renderCrossedSquares(IBlockAccess world, RenderBlocks renderer, Block block, int x, int y, int z, TileEntityGarden te)
{
    Tessellator tessellator = Tessellator.instance;
    tessellator.setBrightness(block.getMixedBrightnessForBlock(renderer.blockAccess, x, y, z));
    int l = block.colorMultiplier(renderer.blockAccess, x, y, z);
    //if (l == world.getBiomeGenForCoords(x, z).getBiomeGrassColor(x, y, z))
    //    l = ColorizerGrass.getGrassColor(te.getBiomeTemperature(), te.getBiomeHumidity());

    float f = (float)(l >> 16 & 255) / 255.0F;
    float f1 = (float)(l >> 8 & 255) / 255.0F;
    float f2 = (float)(l & 255) / 255.0F;

    if (EntityRenderer.anaglyphEnable)
    {
        float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F;
        float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F;
        float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F;
        f = f3;
        f1 = f4;
        f2 = f5;
    }

    tessellator.setColorOpaque_F(f, f1, f2);
    double d1 = (double)x;
    double d2 = (double)y;
    double d0 = (double)z;
    long i1;

    IIcon iicon = renderer.getBlockIconFromSideAndMetadata(block, 0, renderer.blockAccess.getBlockMetadata(x, y, z));
    renderer.drawCrossedSquares(iicon, d1, d2, d0, 1.0F);
    return true;
}
 
Example 6
Source File: BlockModelRendererSchematic.java    From litematica with GNU Lesser General Public License v3.0 4 votes vote down vote up
private void renderQuadsSmooth(IBlockAccess blockAccessIn, IBlockState stateIn, BlockPos posIn, BufferBuilder buffer, List<BakedQuad> list, float[] quadBounds, BitSet bitSet, AmbientOcclusionFace aoFace)
{
    Vec3d vec3d = stateIn.getOffset(blockAccessIn, posIn);
    double x = (double)posIn.getX() + vec3d.x;
    double y = (double)posIn.getY() + vec3d.y;
    double z = (double)posIn.getZ() + vec3d.z;
    int i = 0;

    for (int j = list.size(); i < j; ++i)
    {
        BakedQuad bakedquad = list.get(i);
        this.fillQuadBounds(stateIn, bakedquad.getVertexData(), bakedquad.getFace(), quadBounds, bitSet);
        aoFace.updateVertexBrightness(blockAccessIn, stateIn, posIn, bakedquad.getFace(), quadBounds, bitSet);
        buffer.addVertexData(bakedquad.getVertexData());
        buffer.putBrightness4(aoFace.vertexBrightness[0], aoFace.vertexBrightness[1], aoFace.vertexBrightness[2], aoFace.vertexBrightness[3]);

        if (bakedquad.hasTintIndex())
        {
            int k = this.blockColors.colorMultiplier(stateIn, blockAccessIn, posIn, bakedquad.getTintIndex());

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

            float f = (float)(k >> 16 & 255) / 255.0F;
            float f1 = (float)(k >> 8 & 255) / 255.0F;
            float f2 = (float)(k & 255) / 255.0F;
            buffer.putColorMultiplier(aoFace.vertexColorMultiplier[0] * f, aoFace.vertexColorMultiplier[0] * f1, aoFace.vertexColorMultiplier[0] * f2, 4);
            buffer.putColorMultiplier(aoFace.vertexColorMultiplier[1] * f, aoFace.vertexColorMultiplier[1] * f1, aoFace.vertexColorMultiplier[1] * f2, 3);
            buffer.putColorMultiplier(aoFace.vertexColorMultiplier[2] * f, aoFace.vertexColorMultiplier[2] * f1, aoFace.vertexColorMultiplier[2] * f2, 2);
            buffer.putColorMultiplier(aoFace.vertexColorMultiplier[3] * f, aoFace.vertexColorMultiplier[3] * f1, aoFace.vertexColorMultiplier[3] * f2, 1);
        }
        else
        {
            buffer.putColorMultiplier(aoFace.vertexColorMultiplier[0], aoFace.vertexColorMultiplier[0], aoFace.vertexColorMultiplier[0], 4);
            buffer.putColorMultiplier(aoFace.vertexColorMultiplier[1], aoFace.vertexColorMultiplier[1], aoFace.vertexColorMultiplier[1], 3);
            buffer.putColorMultiplier(aoFace.vertexColorMultiplier[2], aoFace.vertexColorMultiplier[2], aoFace.vertexColorMultiplier[2], 2);
            buffer.putColorMultiplier(aoFace.vertexColorMultiplier[3], aoFace.vertexColorMultiplier[3], aoFace.vertexColorMultiplier[3], 1);
        }

        buffer.putPosition(x, y, z);
    }
}
 
Example 7
Source File: BlockModelRendererSchematic.java    From litematica with GNU Lesser General Public License v3.0 4 votes vote down vote up
private void renderQuadsFlat(IBlockAccess blockAccessIn, IBlockState stateIn, BlockPos posIn, int brightnessIn, boolean ownBrightness, BufferBuilder buffer, List<BakedQuad> list, BitSet bitSet)
{
    Vec3d vec3d = stateIn.getOffset(blockAccessIn, posIn);
    double d0 = (double)posIn.getX() + vec3d.x;
    double d1 = (double)posIn.getY() + vec3d.y;
    double d2 = (double)posIn.getZ() + vec3d.z;
    int i = 0;

    for (int j = list.size(); i < j; ++i)
    {
        BakedQuad bakedquad = list.get(i);

        if (ownBrightness)
        {
            this.fillQuadBounds(stateIn, bakedquad.getVertexData(), bakedquad.getFace(), (float[])null, bitSet);
            BlockPos blockpos = bitSet.get(0) ? posIn.offset(bakedquad.getFace()) : posIn;
            brightnessIn = stateIn.getPackedLightmapCoords(blockAccessIn, blockpos);
        }

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

        if (bakedquad.hasTintIndex())
        {
            int k = this.blockColors.colorMultiplier(stateIn, blockAccessIn, posIn, bakedquad.getTintIndex());

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

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

        buffer.putPosition(d0, d1, d2);
    }
}
 
Example 8
Source File: RendererRoadLine.java    From Chisel-2 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block b, int modelId, RenderBlocks renderer) {
	int meta = world.getBlockMetadata(x, y, z);
	BlockRoadLine block = (BlockRoadLine) b;
	Tessellator tessellator = Tessellator.instance;

	tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));

	float f = 1.0F;
	int i1 = block.colorMultiplier(world, x, y, z);
	float f1 = (i1 >> 16 & 255) / 255.0F;
	float f2 = (i1 >> 8 & 255) / 255.0F;
	float f3 = (i1 & 255) / 255.0F;

	if (EntityRenderer.anaglyphEnable) {
		float f4 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F;
		float f5 = (f1 * 30.0F + f2 * 70.0F) / 100.0F;
		float f6 = (f1 * 30.0F + f3 * 70.0F) / 100.0F;
		f1 = f4;
		f2 = f5;
		f3 = f6;
	}
	tessellator.setColorOpaque_F(f * f1, f * f2, f * f3);

	boolean N = world.getBlock(x, y, z - 1).equals(block) && world.getBlockMetadata(x, y, z - 1) == meta;
	boolean S = world.getBlock(x, y, z + 1).equals(block) && world.getBlockMetadata(x, y, z + 1) == meta;
	boolean W = world.getBlock(x - 1, y, z).equals(block) && world.getBlockMetadata(x - 1, y, z) == meta;
	boolean E = world.getBlock(x + 1, y, z).equals(block) && world.getBlockMetadata(x + 1, y, z) == meta;

	if (!N && !S && !W && !E) {
		renderer.renderStandardBlock(block, x, y, z);
		return true;
	}

	if (N && S) {
		renderer.uvRotateTop = 0;
		renderer.overrideBlockTexture = block.fullLineIcon[meta];
		renderer.renderStandardBlock(block, x, y, z);

	} else {
		if (N) {
			renderer.uvRotateTop = 0;
			renderer.overrideBlockTexture = block.halfLineIcon[meta];
			renderer.renderStandardBlock(block, x, y, z);
		}
		if (S) {
			renderer.uvRotateTop = 3;
			renderer.overrideBlockTexture = block.halfLineIcon[meta];
			renderer.renderStandardBlock(block, x, y, z);
		}

	}

	if (E && W) {
		renderer.uvRotateTop = 1;
		renderer.overrideBlockTexture = block.fullLineIcon[meta];
		renderer.renderStandardBlock(block, x, y, z);
	} else {
		if (E) {
			renderer.uvRotateTop = 1;
			renderer.overrideBlockTexture = block.halfLineIcon[meta];
			renderer.renderStandardBlock(block, x, y, z);
		}
		if (W) {
			renderer.uvRotateTop = 2;
			renderer.overrideBlockTexture = block.halfLineIcon[meta];
			renderer.renderStandardBlock(block, x, y, z);
		}
	}

	renderer.uvRotateTop = 0;
	renderer.overrideBlockTexture = null;
	return true;
}
 
Example 9
Source File: GardenProxyRenderer.java    From GardenCollection with MIT License 4 votes vote down vote up
private boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, BlockGardenProxy block, int modelId, RenderBlocks renderer) {
    TileEntityGarden te = block.getGardenEntity(world, x, y, z);
    BlockGarden garden = block.getGardenBlock(world, x, y, z);
    if (te == null || garden == null)
        return true;

    int section = y - te.yCoord;

    Tessellator tessellator = Tessellator.instance;

    for (int slot : garden.getSlotProfile().getPlantSlots()) {
        Block subBlock = block.getPlantBlockRestricted(te, slot);
        int subBlockData = block.getPlantData(te, slot);
        if (subBlock == null)
            continue;

        block.bindSlot(te.getWorldObj(), x, y, z, te, slot);

        float offsetX = block.getPlantOffsetX(world, x, y, z, slot);
        float offsetY = block.getPlantOffsetY(world, x, y, z, slot);
        float offsetZ = block.getPlantOffsetZ(world, x, y, z, slot);

        AxisAlignedBB[] clippingBounds = garden.getSlotProfile().getClippingBounds(world, x, te.yCoord, z, slot);

        int color = subBlock.colorMultiplier(world, x, y, z);
        if (color == world.getBiomeGenForCoords(x, z).getBiomeGrassColor(x, y, z))
            color = ColorizerGrass.getGrassColor(te.getBiomeTemperature(), te.getBiomeHumidity());

        float r = (color >> 16 & 255) / 255f;
        float g = (color >> 8 & 255) / 255f;
        float b = (color & 255) / 255f;

        if (EntityRenderer.anaglyphEnable) {
            float gray = (r * 30.0F + g * 59.0F + b * 11.0F) / 100.0F;
            float ra = (r * 30.0F + g * 70.0F) / 100.0F;
            float ba = (r * 30.0F + b * 70.0F) / 100.0F;
            r = gray;
            g = ra;
            b = ba;
        }

        tessellator.setColorOpaque_F(r, g, b);
        tessellator.setBrightness(subBlock.getMixedBrightnessForBlock(renderer.blockAccess, x, y, z));

        tessellator.addTranslation(offsetX, offsetY, offsetZ);

        try {
            IPlantRenderer plantRenderer = PlantRegistry.instance().getPlantRenderer(subBlock, subBlockData);
            if (plantRenderer != null) {
                IPlantMetaResolver resolver = PlantRegistry.instance().getPlantMetaResolver(subBlock, subBlockData);
                boolean shouldRender = section == 1;
                if (resolver != null && section <= resolver.getPlantHeight(subBlock, subBlockData))
                    shouldRender = true;

                if (shouldRender)
                    plantRenderer.render(world, x, y, z, renderer, subBlock, subBlockData, section, clippingBounds);
            }
            else
                renderer.renderBlockByRenderType(subBlock, x, y, z);
        }
        catch (Exception e) {
            continue;
        }
        finally {
            block.unbindSlot(te.getWorldObj(), x, y, z, te);
            tessellator.addTranslation(-offsetX, -offsetY, -offsetZ);
        }
    }

    return true;
}
 
Example 10
Source File: GardenProxyRenderer.java    From GardenCollection with MIT License 4 votes vote down vote up
private boolean renderBlockDoublePlant(IBlockAccess world, RenderBlocks renderer, BlockDoublePlant block, int x, int y, int z, TileEntityGarden potData)
{
    Tessellator tessellator = Tessellator.instance;
    tessellator.setBrightness(block.getMixedBrightnessForBlock(renderer.blockAccess, x, y, z));
    int l = block.colorMultiplier(renderer.blockAccess, x, y, z);
    //if (l == world.getBiomeGenForCoords(x, z).getBiomeGrassColor(x, y, z))
    //    l = ColorizerGrass.getGrassColor(potData.getBiomeTemperature(), potData.getBiomeHumidity());

    float f = (float)(l >> 16 & 255) / 255.0F;
    float f1 = (float)(l >> 8 & 255) / 255.0F;
    float f2 = (float)(l & 255) / 255.0F;

    if (EntityRenderer.anaglyphEnable)
    {
        float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F;
        float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F;
        float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F;
        f = f3;
        f1 = f4;
        f2 = f5;
    }

    tessellator.setColorOpaque_F(f, f1, f2);
    long j1 = (long)(x * 3129871) ^ (long)z * 116129781L;
    j1 = j1 * j1 * 42317861L + j1 * 11L;
    double d19 = (double)x;
    double d0 = (double)y;
    double d1 = (double)z;
    //d19 += ((double)((float)(j1 >> 16 & 15L) / 15.0F) - 0.5D) * 0.3D;
    //d1 += ((double)((float)(j1 >> 24 & 15L) / 15.0F) - 0.5D) * 0.3D;
    int i1 = renderer.blockAccess.getBlockMetadata(x, y, z);
    boolean flag = false;
    boolean flag1 = BlockDoublePlant.func_149887_c(i1);
    int k1;

    if (flag1)
    {
        k1 = BlockDoublePlant.func_149890_d(renderer.blockAccess.getBlockMetadata(x, y - 1, z));
    }
    else
    {
        k1 = BlockDoublePlant.func_149890_d(i1);
    }

    IIcon iicon = block.func_149888_a(flag1, k1);
    renderer.drawCrossedSquares(iicon, d19, d0, d1, 1.0F);

    if (flag1 && k1 == 0)
    {
        IIcon iicon1 = block.sunflowerIcons[0];
        double d2 = Math.cos((double)j1 * 0.8D) * Math.PI * 0.1D;
        double d3 = Math.cos(d2);
        double d4 = Math.sin(d2);
        double d5 = (double)iicon1.getMinU();
        double d6 = (double)iicon1.getMinV();
        double d7 = (double)iicon1.getMaxU();
        double d8 = (double)iicon1.getMaxV();
        double d9 = 0.3D;
        double d10 = -0.05D;
        double d11 = 0.5D + 0.3D * d3 - 0.5D * d4;
        double d12 = 0.5D + 0.5D * d3 + 0.3D * d4;
        double d13 = 0.5D + 0.3D * d3 + 0.5D * d4;
        double d14 = 0.5D + -0.5D * d3 + 0.3D * d4;
        double d15 = 0.5D + -0.05D * d3 + 0.5D * d4;
        double d16 = 0.5D + -0.5D * d3 + -0.05D * d4;
        double d17 = 0.5D + -0.05D * d3 - 0.5D * d4;
        double d18 = 0.5D + 0.5D * d3 + -0.05D * d4;
        tessellator.addVertexWithUV(d19 + d15, d0 + 1.0D, d1 + d16, d5, d8);
        tessellator.addVertexWithUV(d19 + d17, d0 + 1.0D, d1 + d18, d7, d8);
        tessellator.addVertexWithUV(d19 + d11, d0 + 0.0D, d1 + d12, d7, d6);
        tessellator.addVertexWithUV(d19 + d13, d0 + 0.0D, d1 + d14, d5, d6);
        IIcon iicon2 = block.sunflowerIcons[1];
        d5 = (double)iicon2.getMinU();
        d6 = (double)iicon2.getMinV();
        d7 = (double)iicon2.getMaxU();
        d8 = (double)iicon2.getMaxV();
        tessellator.addVertexWithUV(d19 + d17, d0 + 1.0D, d1 + d18, d5, d8);
        tessellator.addVertexWithUV(d19 + d15, d0 + 1.0D, d1 + d16, d7, d8);
        tessellator.addVertexWithUV(d19 + d13, d0 + 0.0D, d1 + d14, d7, d6);
        tessellator.addVertexWithUV(d19 + d11, d0 + 0.0D, d1 + d12, d5, d6);
    }

    return true;
}
 
Example 11
Source File: BlockRoadLineRenderer.java    From Chisel with GNU General Public License v2.0 4 votes vote down vote up
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block b, int modelId, RenderBlocks renderer)
{
    int meta = world.getBlockMetadata(x, y, z);
    BlockRoadLine block = (BlockRoadLine) b;
    Tessellator tessellator = Tessellator.instance;

    tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));

    float f = 1.0F;
    int i1 = block.colorMultiplier(world, x, y, z);
    float f1 = (i1 >> 16 & 255) / 255.0F;
    float f2 = (i1 >> 8 & 255) / 255.0F;
    float f3 = (i1 & 255) / 255.0F;

    if(EntityRenderer.anaglyphEnable)
    {
        float f4 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F;
        float f5 = (f1 * 30.0F + f2 * 70.0F) / 100.0F;
        float f6 = (f1 * 30.0F + f3 * 70.0F) / 100.0F;
        f1 = f4;
        f2 = f5;
        f3 = f6;
    }
    tessellator.setColorOpaque_F(f * f1, f * f2, f * f3);

    boolean N = world.getBlock(x, y, z - 1).equals(block);
    boolean S = world.getBlock(x, y, z + 1).equals(block);
    boolean W = world.getBlock(x - 1, y, z).equals(block);
    boolean E = world.getBlock(x + 1, y, z).equals(block);

    if(!N && !S && !W && !E)
    {
        renderer.renderStandardBlock(block, x, y, z);
        return true;
    }

    if(N && S)
    {
        renderer.uvRotateTop = 0;
        renderer.overrideBlockTexture = block.fullLineIcon;
        renderer.renderStandardBlock(block, x, y, z);

    } else
    {
        if(N)
        {
            renderer.uvRotateTop = 0;
            renderer.overrideBlockTexture = block.halfLineIcon;
            renderer.renderStandardBlock(block, x, y, z);
        }
        if(S)
        {
            renderer.uvRotateTop = 3;
            renderer.overrideBlockTexture = block.halfLineIcon;
            renderer.renderStandardBlock(block, x, y, z);
        }

    }

    if(E && W)
    {
        renderer.uvRotateTop = 1;
        renderer.overrideBlockTexture = block.fullLineIcon;
        renderer.renderStandardBlock(block, x, y, z);
    } else
    {
        if(E)
        {
            renderer.uvRotateTop = 1;
            renderer.overrideBlockTexture = block.halfLineIcon;
            renderer.renderStandardBlock(block, x, y, z);
        }
        if(W)
        {
            renderer.uvRotateTop = 2;
            renderer.overrideBlockTexture = block.halfLineIcon;
            renderer.renderStandardBlock(block, x, y, z);
        }
    }

    renderer.uvRotateTop = 0;
    renderer.overrideBlockTexture = null;
    return true;
}
 
Example 12
Source File: RenderFakeBlock.java    From Artifacts with MIT License 4 votes vote down vote up
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
	float f = 0.03125F;
	float xn = 0F;
	float xp = 1F;
	float yn = 0F;
	float yp = 1F;
	float zn = 0F;
	float zp = 1F;
	if(!world.getBlock(x-1, y, z).isOpaqueCube()) {
		if(world.getBlock(x-1, y, z) != block)
			xn = f;
	}
	if(!world.getBlock(x+1, y, z).isOpaqueCube()) {
		if(world.getBlock(x+1, y, z) != block)
			xp = 1F-f;
	}
	if(!world.getBlock(x, y-1, z).isOpaqueCube()) {
		if(world.getBlock(x, y-1, z) != block)
			yn = f;
	}
	if(!world.getBlock(x, y+1, z).isOpaqueCube()) {
		if(world.getBlock(x, y+1, z) != block)
			yp = 1F-f;
	}
	if(!world.getBlock(x, y, z-1).isOpaqueCube()) {
		if(world.getBlock(x, y, z-1) != block)
			zn = f;
	}
	if(!world.getBlock(x, y, z+1).isOpaqueCube()) {
		if(world.getBlock(x, y, z+1) != block)
			zp = 1F-f;
	}
	//block.setBlockBounds(xn, yn, zn, xp, yp, zp);
	renderer.setRenderBounds(xn, yn, zn, xp, yp, zp);
	
	int l = block.colorMultiplier(world, x, y, z);
       float f0 = (float)(l >> 16 & 255) / 255.0F;
       float f1 = (float)(l >> 8 & 255) / 255.0F;
       float f2 = (float)(l & 255) / 255.0F;

       if (EntityRenderer.anaglyphEnable)
       {
           float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F;
           float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F;
           float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F;
           f0 = f3;
           f1 = f4;
           f2 = f5;
       }
       
       //if() {
       /*f0 *= 1.5;
       f1 *= 1.5;
       f2 *= 1.5;*/
       //}

       return renderer.renderStandardBlockWithColorMultiplier(block, x, y, z, f0, f1, f2);
}