if (tree == null)
return;
GL11.glEnable(GL11.GL_BLEND);
TileLeaves leaves = new TileLeaves();
leaves.setTree(tree);
leaves.setDecorative();
IIcon leavesIcon = leaves.getIcon(Proxies.render.fancyGraphicsEnabled());
if (leavesIcon == null)
return;
int color = leaves.determineFoliageColour();
float r1 = (float)(color >> 16 & 255) / 255.0F;
float g1 = (float)(color >> 8 & 255) / 255.0F;
float b1 = (float)(color & 255) / 255.0F;
GL11.glColor4f(r1, g1, b1, 1.0F);
GL11.glTranslatef(x, y, z);
block.setBlockBoundsForItemRender();
renderer.setRenderBoundsFromBlock(block);
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1.0F, 0.0F);
renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, leavesIcon);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, leavesIcon);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1.0F);
renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, leavesIcon);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, leavesIcon);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1.0F, 0.0F, 0.0F);
renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, leavesIcon);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, leavesIcon);
tessellator.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
// add fruit
if (!leaves.hasFruit())
return;
int fruitColor = leaves.getFruitColour();
IIcon fruitTexture = leaves.getFruitTexture();
if (fruitTexture == null)
return;
float r2 = (float)(fruitColor >> 16 & 255) / 255.0F;
float g2 = (float)(fruitColor >> 8 & 255) / 255.0F;