本文整理汇总了Java中net.minecraft.block.Block.colorMultiplier方法的典型用法代码示例。如果您正苦于以下问题:Java Block.colorMultiplier方法的具体用法?Java Block.colorMultiplier怎么用?Java Block.colorMultiplier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.block.Block
的用法示例。
在下文中一共展示了Block.colorMultiplier方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStemColorMultiplier
import net.minecraft.block.Block; //导入方法依赖的package包/类
public static int getStemColorMultiplier(Block p_getStemColorMultiplier_0_, IBlockAccess p_getStemColorMultiplier_1_, BlockPos p_getStemColorMultiplier_2_, RenderEnv p_getStemColorMultiplier_3_)
{
if (stemColors == null)
{
return p_getStemColorMultiplier_0_.colorMultiplier(p_getStemColorMultiplier_1_, p_getStemColorMultiplier_2_);
}
else
{
int i = p_getStemColorMultiplier_3_.getMetadata();
if (i < 0)
{
i = 0;
}
if (i >= stemColors.length)
{
i = stemColors.length - 1;
}
return stemColors[i];
}
}
示例2: 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;
}
示例3: getFluidColor
import net.minecraft.block.Block; //导入方法依赖的package包/类
public static int getFluidColor(IBlockAccess p_getFluidColor_0_, IBlockState p_getFluidColor_1_, BlockPos p_getFluidColor_2_, RenderEnv p_getFluidColor_3_)
{
Block block = p_getFluidColor_1_.getBlock();
CustomColors.IColorizer customcolors$icolorizer = getBlockColormap(p_getFluidColor_1_);
if (customcolors$icolorizer == null && block.getMaterial() == Material.water)
{
customcolors$icolorizer = COLORIZER_WATER;
}
return customcolors$icolorizer == null ? block.colorMultiplier(p_getFluidColor_0_, p_getFluidColor_2_) : (Config.isSmoothBiomes() && !customcolors$icolorizer.isColorConstant() ? getSmoothColorMultiplier(p_getFluidColor_0_, p_getFluidColor_2_, customcolors$icolorizer, p_getFluidColor_3_.getColorizerBlockPosM()) : customcolors$icolorizer.getColor(p_getFluidColor_0_, p_getFluidColor_2_));
}
示例4: renderModelAmbientOcclusionQuads
import net.minecraft.block.Block; //导入方法依赖的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);
}
}
示例5: 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);
}
}
示例6: getSmoothColorMultiplier
import net.minecraft.block.Block; //导入方法依赖的package包/类
private static int getSmoothColorMultiplier(Block p_getSmoothColorMultiplier_0_, IBlockAccess p_getSmoothColorMultiplier_1_, BlockPos p_getSmoothColorMultiplier_2_, int[] p_getSmoothColorMultiplier_3_, int[] p_getSmoothColorMultiplier_4_, int p_getSmoothColorMultiplier_5_, int p_getSmoothColorMultiplier_6_, RenderEnv p_getSmoothColorMultiplier_7_)
{
int i = 0;
int j = 0;
int k = 0;
int l = p_getSmoothColorMultiplier_2_.getX();
int i1 = p_getSmoothColorMultiplier_2_.getY();
int j1 = p_getSmoothColorMultiplier_2_.getZ();
BlockPosM blockposm = p_getSmoothColorMultiplier_7_.getColorizerBlockPosM();
for (int k1 = l - 1; k1 <= l + 1; ++k1)
{
for (int l1 = j1 - 1; l1 <= j1 + 1; ++l1)
{
blockposm.setXyz(k1, i1, l1);
int[] aint = p_getSmoothColorMultiplier_3_;
if (p_getSmoothColorMultiplier_4_ != p_getSmoothColorMultiplier_3_ && p_getSmoothColorMultiplier_1_.getBiomeGenForCoords(blockposm) == BiomeGenBase.swampland)
{
aint = p_getSmoothColorMultiplier_4_;
}
int i2 = 0;
if (aint == null)
{
switch (p_getSmoothColorMultiplier_5_)
{
case 1:
i2 = p_getSmoothColorMultiplier_1_.getBiomeGenForCoords(blockposm).getGrassColorAtPos(blockposm);
break;
case 2:
if ((p_getSmoothColorMultiplier_6_ & 3) == 1)
{
i2 = ColorizerFoliage.getFoliageColorPine();
}
else if ((p_getSmoothColorMultiplier_6_ & 3) == 2)
{
i2 = ColorizerFoliage.getFoliageColorBirch();
}
else
{
i2 = p_getSmoothColorMultiplier_1_.getBiomeGenForCoords(blockposm).getFoliageColorAtPos(blockposm);
}
break;
default:
i2 = p_getSmoothColorMultiplier_0_.colorMultiplier(p_getSmoothColorMultiplier_1_, blockposm);
}
}
else
{
i2 = getCustomColor(aint, p_getSmoothColorMultiplier_1_, blockposm);
}
i += i2 >> 16 & 255;
j += i2 >> 8 & 255;
k += i2 & 255;
}
}
int j2 = i / 9;
int k2 = j / 9;
int l2 = k / 9;
return j2 << 16 | k2 << 8 | l2;
}
示例7: getFluidColor
import net.minecraft.block.Block; //导入方法依赖的package包/类
public static int getFluidColor(Block p_getFluidColor_0_, IBlockAccess p_getFluidColor_1_, BlockPos p_getFluidColor_2_)
{
return p_getFluidColor_0_.getMaterial() != Material.water ? p_getFluidColor_0_.colorMultiplier(p_getFluidColor_1_, p_getFluidColor_2_) : (waterColors != null ? (Config.isSmoothBiomes() ? getSmoothColor(waterColors, p_getFluidColor_1_, (double)p_getFluidColor_2_.getX(), (double)p_getFluidColor_2_.getY(), (double)p_getFluidColor_2_.getZ(), 3, 1) : getCustomColor(waterColors, p_getFluidColor_1_, p_getFluidColor_2_)) : (!Config.isSwampColors() ? 16777215 : p_getFluidColor_0_.colorMultiplier(p_getFluidColor_1_, p_getFluidColor_2_)));
}
示例8: getSmoothColorMultiplier
import net.minecraft.block.Block; //导入方法依赖的package包/类
private static int getSmoothColorMultiplier(Block p_getSmoothColorMultiplier_0_, IBlockAccess p_getSmoothColorMultiplier_1_, BlockPos p_getSmoothColorMultiplier_2_, int[] p_getSmoothColorMultiplier_3_, int[] p_getSmoothColorMultiplier_4_, int p_getSmoothColorMultiplier_5_, int p_getSmoothColorMultiplier_6_, RenderEnv p_getSmoothColorMultiplier_7_)
{
int i = 0;
int j = 0;
int k = 0;
int l = p_getSmoothColorMultiplier_2_.getX();
int i1 = p_getSmoothColorMultiplier_2_.getY();
int j1 = p_getSmoothColorMultiplier_2_.getZ();
BlockPosM blockposm = p_getSmoothColorMultiplier_7_.getColorizerBlockPos();
for (int k1 = l - 1; k1 <= l + 1; ++k1)
{
for (int l1 = j1 - 1; l1 <= j1 + 1; ++l1)
{
blockposm.setXyz(k1, i1, l1);
int[] aint = p_getSmoothColorMultiplier_3_;
if (p_getSmoothColorMultiplier_4_ != p_getSmoothColorMultiplier_3_ && p_getSmoothColorMultiplier_1_.getBiomeGenForCoords(blockposm) == BiomeGenBase.swampland)
{
aint = p_getSmoothColorMultiplier_4_;
}
int i2 = 0;
if (aint == null)
{
switch (p_getSmoothColorMultiplier_5_)
{
case 1:
i2 = p_getSmoothColorMultiplier_1_.getBiomeGenForCoords(blockposm).getGrassColorAtPos(blockposm);
break;
case 2:
if ((p_getSmoothColorMultiplier_6_ & 3) == 1)
{
i2 = ColorizerFoliage.getFoliageColorPine();
}
else if ((p_getSmoothColorMultiplier_6_ & 3) == 2)
{
i2 = ColorizerFoliage.getFoliageColorBirch();
}
else
{
i2 = p_getSmoothColorMultiplier_1_.getBiomeGenForCoords(blockposm).getFoliageColorAtPos(blockposm);
}
break;
default:
i2 = p_getSmoothColorMultiplier_0_.colorMultiplier(p_getSmoothColorMultiplier_1_, blockposm);
}
}
else
{
i2 = getCustomColor(aint, p_getSmoothColorMultiplier_1_, blockposm);
}
i += i2 >> 16 & 255;
j += i2 >> 8 & 255;
k += i2 & 255;
}
}
int j2 = i / 9;
int k2 = j / 9;
int l2 = k / 9;
return j2 << 16 | k2 << 8 | l2;
}