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


Java TextureUtil.anaglyphColor方法代码示例

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


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

示例1: renderQuads

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
private static void renderQuads(BufferBuilder renderer, List<BakedQuad> quads, int color, ItemStack stack) {
    boolean flag = color == -1 && !stack.isEmpty();
    int i = 0;

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

        if (flag && bakedquad.hasTintIndex()) {
            k = Minecraft.getMinecraft().getItemColors().colorMultiplier(stack, bakedquad.getTintIndex());
            if (EntityRenderer.anaglyphEnable) {
                k = TextureUtil.anaglyphColor(k);
            }

            k = k | -16777216;
        }

        net.minecraftforge.client.model.pipeline.LightUtil.renderQuadColor(renderer, bakedquad, k);
    }
}
 
开发者ID:Buuz135,项目名称:Industrial-Foregoing,代码行数:21,代码来源:ItemStackUtils.java

示例2: renderQuads

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
public static void renderQuads(VertexBuffer renderer, List<BakedQuad> quads, int color, ItemStack stack) {
	boolean flag = (color == -1) && (!stack.isEmpty());
	int i = 0;
	for (int j = quads.size(); i < j; i++) {
		BakedQuad bakedquad = quads.get(i);
		int k = color;
		if ((flag) && (bakedquad.hasTintIndex())) {
			ItemColors itemColors = Minecraft.getMinecraft().getItemColors();
			k = itemColors.getColorFromItemstack(stack, bakedquad.getTintIndex());
			if (EntityRenderer.anaglyphEnable) {
				k = TextureUtil.anaglyphColor(k);
			}
			k |= 0xFF000000;
		}
		LightUtil.renderQuadColor(renderer, bakedquad, k);
	}
}
 
开发者ID:p455w0rd,项目名称:DankNull,代码行数:18,代码来源:RenderModel.java

示例3: renderQuads

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
private void renderQuads(WorldRenderer renderer, List<BakedQuad> quads, int color, ItemStack stack)
{
    boolean flag = color == -1 && stack != null;
    int i = 0;

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

        if (flag && bakedquad.hasTintIndex())
        {
            k = stack.getItem().getColorFromItemStack(stack, bakedquad.getTintIndex());

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

            k = k | -16777216;
        }

        this.renderQuad(renderer, bakedquad, k);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:26,代码来源:RenderItem.java

示例4: renderModelBrightness

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
public void renderModelBrightness(IBakedModel p_178266_1_, IBlockState p_178266_2_, float p_178266_3_, boolean p_178266_4_)
{
    Block block = p_178266_2_.getBlock();
    block.setBlockBoundsForItemRender();
    GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F);
    int i = block.getRenderColor(block.getStateForEntityRender(p_178266_2_));

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

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

    if (!p_178266_4_)
    {
        GlStateManager.color(p_178266_3_, p_178266_3_, p_178266_3_, 1.0F);
    }

    this.renderModelBrightnessColor(p_178266_1_, p_178266_3_, f, f1, f2);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:24,代码来源:BlockModelRenderer.java

示例5: renderModelBrightness

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
public void renderModelBrightness(IBakedModel model, IBlockState state, float brightness, boolean p_178266_4_)
{
    Block block = state.getBlock();
    GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F);
    int i = this.blockColors.colorMultiplier(state, (IBlockAccess)null, (BlockPos)null, 0);

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

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

    if (!p_178266_4_)
    {
        GlStateManager.color(brightness, brightness, brightness, 1.0F);
    }

    this.renderModelBrightnessColor(state, model, brightness, f, f1, f2);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:23,代码来源:BlockModelRenderer.java

示例6: renderQuads

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
private void renderQuads(VertexBuffer renderer, List<BakedQuad> quads, int color, @Nullable ItemStack stack)
{
    boolean flag = color == -1 && stack != null;
    int i = 0;

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

        if (flag && bakedquad.hasTintIndex())
        {
            k = this.itemColors.getColorFromItemstack(stack, bakedquad.getTintIndex());

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

            k = k | -16777216;
        }

        net.minecraftforge.client.model.pipeline.LightUtil.renderQuadColor(renderer, bakedquad, k);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:26,代码来源:RenderItem.java

示例7: renderQuads

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
private void renderQuads(BufferBuilder renderer, List<BakedQuad> quads, int color, ItemStack stack)
{
    boolean flag = color == -1 && !stack.isEmpty();
    int i = 0;

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

        if (flag && bakedquad.hasTintIndex())
        {
            k = this.mc.getItemColors().getColorFromItemstack(stack, bakedquad.getTintIndex());

            if (EntityRenderer.anaglyphEnable)
                k = TextureUtil.anaglyphColor(k);
            k = k | -16777216;
        }
        LightUtil.renderQuadColor(renderer, bakedquad, k);
    }
}
 
开发者ID:Yggard,项目名称:BrokkGUI,代码行数:22,代码来源:GuiRenderItemHelper.java

示例8: RenderHelper_a

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
private void RenderHelper_a(BufferBuilder p_175032_1_, List p_175032_2_, int p_175032_3_, ItemStack p_175032_4_) {
	boolean flag = p_175032_3_ == -1 && p_175032_4_ != null;
	BakedQuad bakedquad;
	int j;

	for (Iterator iterator = p_175032_2_.iterator(); iterator.hasNext(); this.RenderHelper_B(p_175032_1_, bakedquad, j)) {
		bakedquad = (BakedQuad) iterator.next();
		j = p_175032_3_;

		if (flag && bakedquad.hasTintIndex()) {
			// j = p_175032_4_.getItem().getColorFromItemStack(p_175032_4_, bakedquad.getTintIndex());

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

			j |= -16777216;
		}
	}
}
 
开发者ID:TechStack,项目名称:TechStack-s-HeavyMachineryMod,代码行数:21,代码来源:TileEntityCrateRenderer.java

示例9: renderQuads

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
private static void renderQuads(BufferBuilder renderer, List<BakedQuad> quads, int color, ItemStack stack)
{
    boolean flag = color == -1 && stack != null;
    int i = 0;

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

        if(flag && bakedquad.hasTintIndex())
        {
            k = Minecraft.getMinecraft().getItemColors().colorMultiplier(stack, bakedquad.getTintIndex());

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

            k = k | -16777216;
        }

        net.minecraftforge.client.model.pipeline.LightUtil.renderQuadColor(renderer, bakedquad, k);
    }
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:26,代码来源:RendererHelper.java

示例10: renderQuads

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
private void renderQuads(WorldRenderer renderer, List quads, int color, ItemStack stack)
{
    boolean flag = color == -1 && stack != null;
    int i = 0;

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

        if (flag && bakedquad.hasTintIndex())
        {
            k = stack.getItem().getColorFromItemStack(stack, bakedquad.getTintIndex());

            if (Config.isCustomColors())
            {
                k = CustomColors.getColorFromItemStack(stack, bakedquad.getTintIndex(), k);
            }

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

            k = k | -16777216;
        }

        this.renderQuad(renderer, bakedquad, k);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:31,代码来源:RenderItem.java

示例11: renderQuads

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
private void renderQuads(VertexBuffer renderer, List<BakedQuad> quads, int color, ItemStack stack)
{
    boolean flag = color == -1 && !stack.func_190926_b();
    int i = 0;

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

        if (flag && bakedquad.hasTintIndex())
        {
            k = this.itemColors.getColorFromItemstack(stack, bakedquad.getTintIndex());

            if (Config.isCustomColors())
            {
                k = CustomColors.getColorFromItemStack(stack, bakedquad.getTintIndex(), k);
            }

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

            k = k | -16777216;
        }

        this.renderQuad(renderer, bakedquad, k);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:31,代码来源:RenderItem.java

示例12: addCover

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
public void addCover(final CoverData data, final EnumFacing dir, final List<BakedQuad> list){
	final List<BakedQuad> bakedQuads = new LinkedList<BakedQuad>();
	ItemStack stack = new ItemStack(data.getBlockState().getBlock(), 1, data.getBlockState().getBlock().getMetaFromState(data.getBlockState()));
	IBakedModel model = Minecraft.getMinecraft().getRenderItem().getItemModelWithOverrides(stack, (World)null, (EntityLivingBase)null);
	bakedQuads.addAll(model.getQuads((IBlockState)null, (EnumFacing)null, 0L));
	for (final EnumFacing face2 : EnumFacing.VALUES) {
		bakedQuads.addAll(model.getQuads((IBlockState)null, face2, 0L));
	}
	List<CustomBakedQuad> quads = CustomBakedQuad.fromArray(bakedQuads);
	quads = CoverRender.sliceQuads(quads, 3, CoverUtil.getCoverBoundingBox(EnumFacing.SOUTH, true));
	for(CustomBakedQuad quad : quads){
		for(int i = 0; i < 4; i++){
			quad.vertices[i].vec.z -=0.45d;
		}
		int color = -1;
		if (quad.hasTint()) {
			color = Minecraft.getMinecraft().getItemColors().getColorFromItemstack(stack, quad.tintIndex);
			if (EntityRenderer.anaglyphEnable) {
				color = TextureUtil.anaglyphColor(color);
			}
			color |= 0xFF000000;
		}
		final CustomBakedQuad copyQuad = quad.copy();
		final ColorData c = new ColorDataARGB(color);
		for (final ColorData qC : copyQuad.colours) {
			qC.multiply(c);
		}
		list.add(copyQuad.bake(DefaultVertexFormats.ITEM));
	}
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:31,代码来源:ModelCover.java

示例13: ParticleItem

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
public ParticleItem(World world, double xCoordIn, double yCoordIn, double zCoordIn, double motionXIn,
		double motionYIn, double motionZIn, float par14, boolean disableMoving, ItemStack stack) {
	super(world, xCoordIn, yCoordIn, zCoordIn, motionXIn, motionYIn, motionZIn, par14, disableMoving);
	this.setParticleTexture(Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getParticleIcon(stack.getItem(), stack.getMetadata()));
	if(stack.getItem() instanceof ItemBlock)
        this.setParticleTexture(Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getTexture(((ItemBlock)stack.getItem()).getBlock().getStateFromMeta(stack.getMetadata())));
	if(stack.getItem() instanceof UniversalBucket)
		if(new Random().nextBoolean())
			this.setParticleTexture(Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getTexture(((UniversalBucket)stack.getItem()).getFluid(stack).getFluid().getBlock().getDefaultState()));
		else
			this.setParticleTexture(Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getParticleIcon(Items.BUCKET));
	if(stack.getItem() instanceof ItemBed)
	{
		fxLayer = 3;
		setLocation(new ResourceLocation("textures/entity/bed/" + EnumDyeColor.byMetadata(stack.getMetadata()).getName() + ".png"));
		return;
	}
	List<BakedQuad> quadList = Minecraft.getMinecraft().getRenderItem().getItemModelWithOverrides(stack, world, Minecraft.getMinecraft().player).getQuads((IBlockState)null, (EnumFacing)null, 0L);
	int i = 0;
	boolean flag = !stack.isEmpty();
	boolean flag2 = false;
	ArrayList<Integer> colors = new ArrayList<Integer>();
	for (int j = quadList.size(); i < j; ++i)
       {
           BakedQuad bakedquad = quadList.get(i);
           int k = -1;
           if (flag && bakedquad.hasTintIndex())
           {
           	flag2 = true;
               k = Minecraft.getMinecraft().getItemColors().colorMultiplier(stack, bakedquad.getTintIndex());
               if (EntityRenderer.anaglyphEnable)
                   k = TextureUtil.anaglyphColor(k);

               k = k | -16777216;
               colors.add(k);
           }
       }
	if(flag2)
	{
		int color = colors.get(new Random().nextInt(colors.size()));
		this.particleRed = ((color >> 16) & 0xFF) * 255;
		this.particleGreen = ((color >> 8) & 0xFF) * 255;
		this.particleBlue = ((color >> 0) & 0xFF) * 255;
	}
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:46,代码来源:ParticleItem.java

示例14: renderModelAmbientOcclusionQuads

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
private void renderModelAmbientOcclusionQuads(IBlockAccess blockAccessIn, Block blockIn, BlockPos blockPosIn, WorldRenderer worldRendererIn, List<BakedQuad> listQuadsIn, float[] quadBounds, BitSet boundsFlags, BlockModelRenderer.AmbientOcclusionFace aoFaceIn)
{
    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)
    {
        long i = MathHelper.getPositionRandom(blockPosIn);
        d0 += ((double)((float)(i >> 16 & 15L) / 15.0F) - 0.5D) * 0.5D;
        d2 += ((double)((float)(i >> 24 & 15L) / 15.0F) - 0.5D) * 0.5D;

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

    for (BakedQuad bakedquad : listQuadsIn)
    {
        this.fillQuadBounds(blockIn, bakedquad.getVertexData(), bakedquad.getFace(), quadBounds, boundsFlags);
        aoFaceIn.updateVertexBrightness(blockAccessIn, blockIn, blockPosIn, bakedquad.getFace(), quadBounds, boundsFlags);
        worldRendererIn.addVertexData(bakedquad.getVertexData());
        worldRendererIn.putBrightness4(aoFaceIn.vertexBrightness[0], aoFaceIn.vertexBrightness[1], aoFaceIn.vertexBrightness[2], aoFaceIn.vertexBrightness[3]);

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

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

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

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

示例15: renderModelStandardQuads

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的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


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