Пример #1
0
  @Override
  @SideOnly(Side.CLIENT)
  public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
    int l = 0;
    int i1 = 0;
    int j1 = 0;
    int meta = world.getBlockMetadata(x, y, z);

    for (int k1 = -1; k1 <= 1; ++k1) {
      for (int l1 = -1; l1 <= 1; ++l1) {
        BiomeGenBase biome = world.getBiomeGenForCoords(x + l1, z + k1);
        int grassColor = 0;
        if (meta == 1) {
          double temp = (double) MathHelper.clamp_float(biome.getFloatTemperature(), 0.0F, 1.0F);
          double rainfall = (double) MathHelper.clamp_float(biome.getFloatRainfall(), 0.0F, 1.0F);
          grassColor = GrassColorizerAlternate.getBlueGrassColor(temp, rainfall);
        } else if (meta == 2) {
          double temp = (double) MathHelper.clamp_float(biome.getFloatTemperature(), 0.0F, 1.0F);
          double rainfall = (double) MathHelper.clamp_float(biome.getFloatRainfall(), 0.0F, 1.0F);
          grassColor = GrassColorizerAlternate.getOrangeGrassColor(temp, rainfall);
        } else {
          grassColor = biome.getBiomeGrassColor();
        }
        l += (grassColor & 16711680) >> 16;
        i1 += (grassColor & 65280) >> 8;
        j1 += grassColor & 255;
      }
    }
    return (l / 9 & 255) << 16 | (i1 / 9 & 255) << 8 | j1 / 9 & 255;
  }
Пример #2
0
 @Override
 @SideOnly(Side.CLIENT)
 public int getRenderColor(int meta) {
   /*if (par1 % 8 == 0)
       return this.getBlockColor();
   return 0xFFFFFF;*/
   double d0 = 0.5D;
   double d1 = 1.0D;
   if (meta == 1) return GrassColorizerAlternate.getBlueGrassColor(d0, 0.5D);
   if (meta == 2) return GrassColorizerAlternate.getOrangeGrassColor(1.0D, 1.0D);
   return ColorizerGrass.getGrassColor(d0, d1);
 }