Example #1
0
  @SideOnly(Side.CLIENT)

  /**
   * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color.
   * Note only called when first determining what to render.
   */
  public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
    int l = par1IBlockAccess.getBlockMetadata(par2, par3, par4);

    if ((l & 3) == 1) {
      return ColorizerFoliage.getFoliageColorPine();
    } else if ((l & 3) == 2) {
      return ColorizerFoliage.getFoliageColorBirch();
    } else {
      int i1 = 0;
      int j1 = 0;
      int k1 = 0;

      for (int l1 = -1; l1 <= 1; ++l1) {
        for (int i2 = -1; i2 <= 1; ++i2) {
          int j2 =
              par1IBlockAccess.getBiomeGenForCoords(par2 + i2, par4 + l1).getBiomeFoliageColor();
          i1 += (j2 & 16711680) >> 16;
          j1 += (j2 & 65280) >> 8;
          k1 += j2 & 255;
        }
      }

      return (i1 / 9 & 255) << 16 | (j1 / 9 & 255) << 8 | k1 / 9 & 255;
    }
  }
 @SideOnly(Side.CLIENT)
 @Override
 public int getRenderColor(int p_149741_1_) {
   return (p_149741_1_ & 3) == 1
       ? ColorizerFoliage.getFoliageColorPine()
       : (p_149741_1_ & 3) == 2
           ? ColorizerFoliage.getFoliageColorBirch()
           : super.getRenderColor(p_149741_1_);
 }
Example #3
0
  @SideOnly(Side.CLIENT)

  /** Returns the color this block should be rendered. Used by leaves. */
  public int getRenderColor(int par1) {
    return (par1 & 3) == 1
        ? ColorizerFoliage.getFoliageColorPine()
        : ((par1 & 3) == 2
            ? ColorizerFoliage.getFoliageColorBirch()
            : ColorizerFoliage.getFoliageColorBasic());
  }
  @SideOnly(Side.CLIENT)
  @Override
  public int colorMultiplier(IBlockAccess blockAccess, int x, int y, int z) {
    int meta = blockAccess.getBlockMetadata(x, y, z);

    return (meta & 3) == 1
        ? ColorizerFoliage.getFoliageColorPine()
        : (meta & 3) == 2
            ? ColorizerFoliage.getFoliageColorBirch()
            : super.colorMultiplier(blockAccess, x, y, z);
  }