Package forestry.arboriculture.gadgets

Examples of forestry.arboriculture.gadgets.TileLeaves


  }

  @Override
  public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {

    TileLeaves tile = ForestryBlockLeaves.getLeafTile(world, x, y, z);
    if (tile == null || tile.getTree() == null)
      return false;

    // Render the plain leaf block.
    renderer.renderStandardBlock(block, x, y, z);

    // Render overlay for fruit leaves.
    IIcon fruitIcon = null;
    int fruitColor = 0xffffff;
    if (tile != null) {
      fruitIcon = tile.getFruitTexture();
      fruitColor = tile.getFruitColour();
    }

    if (fruitIcon != null)
      renderFruitOverlay(world, block, x, y, z, renderer, fruitIcon, fruitColor);
View Full Code Here


    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;
View Full Code Here

      return false;

    if (!ForestryBlock.leaves.isBlockEqual(world, x, y, z))
      return false;

    TileLeaves tileLeaves = new TileLeaves();
    tileLeaves.setTree((ITree) tree.copy());
    tileLeaves.setOwner(owner);
    if (decorative)
      tileLeaves.setDecorative();

    world.setTileEntity(x, y, z, tileLeaves);

    TileEntity tile = world.getTileEntity(x, y, z);
    if (!(tile instanceof TileLeaves)) {
View Full Code Here

TOP

Related Classes of forestry.arboriculture.gadgets.TileLeaves

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.