本文整理汇总了Java中net.minecraft.world.ColorizerGrass.getGrassColor方法的典型用法代码示例。如果您正苦于以下问题:Java ColorizerGrass.getGrassColor方法的具体用法?Java ColorizerGrass.getGrassColor怎么用?Java ColorizerGrass.getGrassColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.ColorizerGrass
的用法示例。
在下文中一共展示了ColorizerGrass.getGrassColor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: genBiomeColours
import net.minecraft.world.ColorizerGrass; //导入方法依赖的package包/类
private static void genBiomeColours(BlockColours bc) {
// generate array of foliage, grass, and water colour multipliers
// for each biome.
for (Object oBiome : Biome.REGISTRY) {
Biome biome = (Biome) oBiome;
if (biome != null) {
double temp = MathHelper.clamp(biome.getTemperature(), 0.0F, 1.0F);
double rain = MathHelper.clamp(biome.getRainfall(), 0.0F, 1.0F);
int grasscolor = ColorizerGrass.getGrassColor(temp, rain);
int foliagecolor = ColorizerFoliage.getFoliageColor(temp, rain);
int watercolor = biome.getWaterColorMultiplier();
bc.setBiomeData(biome.getBiomeName(), watercolor & 0xffffff, grasscolor & 0xffffff, foliagecolor & 0xffffff);
}
}
}
示例2: getRenderColor
import net.minecraft.world.ColorizerGrass; //导入方法依赖的package包/类
public int getRenderColor(IBlockState state)
{
if (state.getBlock() != this)
{
return super.getRenderColor(state);
}
else
{
BlockTallGrass.EnumType blocktallgrass$enumtype = (BlockTallGrass.EnumType)state.getValue(TYPE);
return blocktallgrass$enumtype == BlockTallGrass.EnumType.DEAD_BUSH ? 16777215 : ColorizerGrass.getGrassColor(0.5D, 1.0D);
}
}
示例3: getBlockColor
import net.minecraft.world.ColorizerGrass; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public int getBlockColor()
{
double d0 = 0.5D;
double d1 = 1.0D;
return ColorizerGrass.getGrassColor(d0, d1);
}
示例4: getBiomeGrassColor
import net.minecraft.world.ColorizerGrass; //导入方法依赖的package包/类
/**
* Provides the basic grass color based on the biome temperature and rainfall
*/
public int getBiomeGrassColor(int p_150558_1_, int p_150558_2_, int p_150558_3_)
{
double var4 = (double)MathHelper.clamp_float(this.getFloatTemperature(p_150558_1_, p_150558_2_, p_150558_3_), 0.0F, 1.0F);
double var6 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F);
return ColorizerGrass.getGrassColor(var4, var6);
}
示例5: getBlockColor
import net.minecraft.world.ColorizerGrass; //导入方法依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public int getBlockColor() {
if (this instanceof IBlockSoil) {
return ColorizerGrass.getGrassColor(0.5D, 1.0D);
} else {
return 16777215;
}
}
示例6: renderWorldBlockPass0
import net.minecraft.world.ColorizerGrass; //导入方法依赖的package包/类
private boolean renderWorldBlockPass0 (IBlockAccess world, int x, int y, int z, BlockMediumPot block, int modelId, RenderBlocks renderer) {
int metadata = world.getBlockMetadata(x, y, z);
boxRenderer.setUnit(.0625);
boxRenderer.setColor(ModularBoxRenderer.COLOR_WHITE);
for (int i = 0; i < 6; i++)
boxRenderer.setIcon(renderer.getBlockIconFromSideAndMetadata(block, i, metadata), i);
boxRenderer.renderBox(world, block, x, y, z, .125, 0, .125, .875, .75, .875, 0, ModularBoxRenderer.CUT_YPOS);
TileEntityMediumPot te = block.getTileEntity(world, x, y, z);
if (te != null && te.getSubstrate() != null && te.getSubstrate().getItem() instanceof ItemBlock) {
Block substrate = Block.getBlockFromItem(te.getSubstrate().getItem());
int substrateData = te.getSubstrate().getItemDamage();
if (substrate != Blocks.water) {
IIcon substrateIcon = renderer.getBlockIconFromSideAndMetadata(substrate, 1, substrateData);
int color = substrate.colorMultiplier(world, x, y, z);
if (color == Blocks.grass.colorMultiplier(world, x, y, z))
color = ColorizerGrass.getGrassColor(te.getBiomeTemperature(), te.getBiomeHumidity());
RenderHelper.calculateBaseColor(colorScratch, color);
RenderHelper.instance.setRenderBounds(.125, 0, .125, .875, .6875f, .875);
RenderHelper.instance.renderFace(RenderHelper.YPOS, world, block, x, y, z, substrateIcon, colorScratch[0], colorScratch[1], colorScratch[2]);
}
}
return true;
}
示例7: getBiomeGrassColor
import net.minecraft.world.ColorizerGrass; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
/**
* Provides the basic grass color based on the biome temperature and rainfall
*/
public int getBiomeGrassColor()
{
double d0 = (double)this.getFloatTemperature();
double d1 = (double)this.getFloatRainfall();
return ((ColorizerGrass.getGrassColor(d0, d1) & 16711422) + 5115470) / 2;
}
示例8: renderCrossedSquares
import net.minecraft.world.ColorizerGrass; //导入方法依赖的package包/类
private boolean renderCrossedSquares(IBlockAccess world, RenderBlocks renderer, Block block, int x, int y, int z, TileEntityLargePot 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);
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;
}
示例9: getBlockColor
import net.minecraft.world.ColorizerGrass; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public int getBlockColor()
{
double var1 = 0.5D;
double var3 = 1.0D;
return ColorizerGrass.getGrassColor(var1, var3);
}
示例10: getBlockColor
import net.minecraft.world.ColorizerGrass; //导入方法依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public int getBlockColor() {
double d0 = 0.5D;
double d1 = 1.0D;
return ColorizerGrass.getGrassColor(d0, d1);
}
示例11: getGrassColorAtPos
import net.minecraft.world.ColorizerGrass; //导入方法依赖的package包/类
public int getGrassColorAtPos(BlockPos pos)
{
double d0 = (double)MathHelper.clamp_float(this.getFloatTemperature(pos), 0.0F, 1.0F);
double d1 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F);
return ColorizerGrass.getGrassColor(d0, d1);
}
示例12: getColorFromItemStack
import net.minecraft.world.ColorizerGrass; //导入方法依赖的package包/类
public int getColorFromItemStack(ItemStack stack, int renderPass)
{
BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype = BlockDoublePlant.EnumPlantType.byMetadata(stack.getMetadata());
return blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.GRASS && blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.FERN ? super.getColorFromItemStack(stack, renderPass) : ColorizerGrass.getGrassColor(0.5D, 1.0D);
}
示例13: getBlockColor
import net.minecraft.world.ColorizerGrass; //导入方法依赖的package包/类
public int getBlockColor()
{
return ColorizerGrass.getGrassColor(0.5D, 1.0D);
}
示例14: getGrassColorAtPos
import net.minecraft.world.ColorizerGrass; //导入方法依赖的package包/类
public int getGrassColorAtPos(BlockPos pos)
{
double d0 = (double)MathHelper.clamp(this.getFloatTemperature(pos), 0.0F, 1.0F);
double d1 = (double)MathHelper.clamp(this.getRainfall(), 0.0F, 1.0F);
return ColorizerGrass.getGrassColor(d0, d1);
}
示例15: colorMultiplier
import net.minecraft.world.ColorizerGrass; //导入方法依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public int colorMultiplier(IBlockState state, IBlockAccess world, BlockPos pos, int tintIndex)
{
return world != null && pos != null ? BiomeColorHelper.getGrassColorAtPos(world, pos) : ColorizerGrass.getGrassColor(0.5D, 1.0D);
}