public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) {
    for (int i = 0;
        ((i = par1World.getBlockId(par3, par4, par5)) == 0 || i == Block.leaves.blockID)
            && par4 > 0;
        par4--) {}

    for (int j = 0; j < 128; j++) {
      int k = (par3 + par2Random.nextInt(8)) - par2Random.nextInt(8);
      int l = (par4 + par2Random.nextInt(4)) - par2Random.nextInt(4);
      int i1 = (par5 + par2Random.nextInt(8)) - par2Random.nextInt(8);

      if (par1World.isAirBlock(k, l, i1)
          && ((Block) Block.blocksList[pileID]).canBlockStay(par1World, k, l, i1)) {
        par1World.setBlockAndMetadata(k, l, i1, pileID, pileMetadata);
      }
    }

    return true;
  }
Esempio n. 2
0
  public void SurroundWithLeaves(World world, int i, int j, int k) {
    for (int y = 0; y <= 1; y++) {
      for (int x = 1; x >= -1; x--) {
        for (int z = 1; z >= -1; z--) {
          if (world.getBlockId(i + x, j + y, k + z) == 0
              && (world.getBlockId(i + x, j + y + 1, k + z) == 0
                  || world.getBlockId(i + x, j + y + 2, k + z) == 0)) {
            int meta = world.getBlockMetadata(i, j, k);
            int id =
                meta < 8 ? TFCBlocks.fruitTreeLeaves.blockID : TFCBlocks.fruitTreeLeaves2.blockID;

            if (world.getBlockId(i, j, k) != TFCBlocks.fruitTreeWood.blockID) id = 0;

            world.setBlockAndMetadata(i + x, j + y, k + z, id, world.getBlockMetadata(i, j, k));
          }
        }
      }
    }
  }
  public boolean generate(World world, Random random, int i, int j, int k) {
    int l = random.nextInt(3) + 4;
    boolean flag = true;
    if (j < 1 || j + l + 1 > world.getHeight()) {
      return false;
    }
    for (int i1 = j; i1 <= j + 1 + l; i1++) {
      byte byte0 = 1;
      if (i1 == j) {
        byte0 = 0;
      }
      if (i1 >= j + 1 + l - 2) {
        byte0 = 2;
      }
      for (int i2 = i - byte0; i2 <= i + byte0 && flag; i2++) {
        for (int l2 = k - byte0; l2 <= k + byte0 && flag; l2++) {
          if (i1 >= 0 && i1 < world.getHeight()) {
            int j3 = world.getBlockId(i2, i1, l2);
            if (j3 != 0 && j3 != mod_TFC_Core.terraLeaves.blockID) {
              flag = false;
            }
          } else {
            flag = false;
          }
        }
      }
    }

    if (!flag) {
      return false;
    }
    int var3 = world.getBlockId(i, j - 1, k);
    if (treeId == 15) {
      int x = 0;
    }
    if (!(var3 == mod_TFC_Core.terraDirt.blockID
            || var3 == mod_TFC_Core.terraDirt2.blockID
            || var3 == mod_TFC_Core.terraGrass.blockID
            || var3 == mod_TFC_Core.terraGrass2.blockID
            || var3 == mod_TFC_Core.terraClayGrass.blockID
            || var3 == mod_TFC_Core.terraClayGrass2.blockID)
        || j >= world.getHeight() - l - 1) {
      return false;
    }
    world.setBlockAndMetadata(
        i,
        j - 1,
        k,
        world.getBiomeGenForCoords(i, k).DirtID,
        world.getBiomeGenForCoords(i, k).SurfaceMeta);
    for (int k1 = j - 3 + l; k1 <= j + l; k1++) {
      int j2 = k1 - (j + l);
      int i3 = 1 - j2 / 2;
      for (int k3 = i - i3; k3 <= i + i3; k3++) {
        int l3 = k3 - i;
        for (int i4 = k - i3; i4 <= k + i3; i4++) {
          int j4 = i4 - k;
          if ((Math.abs(l3) != i3 || Math.abs(j4) != i3 || random.nextInt(2) != 0 && j2 != 0)
              && !Block.opaqueCubeLookup[world.getBlockId(k3, k1, i4)]) {
            setBlockAndMetadata(world, k3, k1, i4, mod_TFC_Core.terraLeaves.blockID, treeId);
          }
        }
      }
    }

    for (int l1 = 0; l1 < l; l1++) {
      int k2 = world.getBlockId(i, j + l1, k);
      if (k2 == 0 || k2 == mod_TFC_Core.terraLeaves.blockID) {
        setBlockAndMetadata(world, i, j + l1, k, mod_TFC_Core.terraWood.blockID, treeId);
      }
    }

    return true;
  }
Esempio n. 4
0
 private void func_30003_j(World world, int i, int j, int k) {
   int l = world.getBlockMetadata(i, j, k);
   world.setBlockAndMetadata(i, j, k, blockID + 1, l);
   world.markBlocksDirty(i, j, k, i, j, k);
   world.markBlockNeedsUpdate(i, j, k);
 }
  /** attempts to extend the piston. returns false if impossible. */
  private boolean tryExtend(World par1World, int par2, int par3, int par4, int par5) {
    int i = par2 + Facing.offsetsXForSide[par5];
    int j = par3 + Facing.offsetsYForSide[par5];
    int k = par4 + Facing.offsetsZForSide[par5];
    int l = 0;

    do {
      if (l >= 13) {
        break;
      }

      if (j <= 0 || j >= 255) {
        return false;
      }

      int j1 = par1World.getBlockId(i, j, k);

      if (j1 == 0) {
        break;
      }

      if (!canPushBlock(j1, par1World, i, j, k, true)) {
        return false;
      }

      if (Block.blocksList[j1].getMobilityFlag() == 1) {
        Block.blocksList[j1].dropBlockAsItem(
            par1World, i, j, k, par1World.getBlockMetadata(i, j, k), 0);
        par1World.setBlockWithNotify(i, j, k, 0);
        break;
      }

      if (l == 12) {
        return false;
      }

      i += Facing.offsetsXForSide[par5];
      j += Facing.offsetsYForSide[par5];
      k += Facing.offsetsZForSide[par5];
      l++;
    } while (true);

    int l1;

    for (; i != par2 || j != par3 || k != par4; k = l1) {
      int i1 = i - Facing.offsetsXForSide[par5];
      int k1 = j - Facing.offsetsYForSide[par5];
      l1 = k - Facing.offsetsZForSide[par5];
      int i2 = par1World.getBlockId(i1, k1, l1);
      int j2 = par1World.getBlockMetadata(i1, k1, l1);

      if (i2 == blockID && i1 == par2 && k1 == par3 && l1 == par4) {
        par1World.setBlockAndMetadata(
            i, j, k, Block.pistonMoving.blockID, par5 | (isSticky ? 8 : 0));
        par1World.setBlockTileEntity(
            i,
            j,
            k,
            BlockPistonMoving.getTileEntity(
                Block.pistonExtension.blockID, par5 | (isSticky ? 8 : 0), par5, true, false));
      } else {
        par1World.setBlockAndMetadata(i, j, k, Block.pistonMoving.blockID, j2);
        par1World.setBlockTileEntity(
            i, j, k, BlockPistonMoving.getTileEntity(i2, j2, par5, true, false));
      }

      i = i1;
      j = k1;
    }

    return true;
  }
  public void powerBlock(World par1World, int par2, int par3, int par4, int par5, int par6) {
    ignoreUpdates = true;
    int i = par6;

    if (par5 == 0) {
      if (tryExtend(par1World, par2, par3, par4, i)) {
        par1World.setBlockMetadataWithNotify(par2, par3, par4, i | 8);
        par1World.playSoundEffect(
            (double) par2 + 0.5D,
            (double) par3 + 0.5D,
            (double) par4 + 0.5D,
            "tile.piston.out",
            0.5F,
            par1World.rand.nextFloat() * 0.25F + 0.6F);
      } else {
        par1World.setBlockMetadata(par2, par3, par4, i);
      }
    } else if (par5 == 1) {
      TileEntity tileentity =
          par1World.getBlockTileEntity(
              par2 + Facing.offsetsXForSide[i],
              par3 + Facing.offsetsYForSide[i],
              par4 + Facing.offsetsZForSide[i]);

      if (tileentity != null && (tileentity instanceof TileEntityPiston)) {
        ((TileEntityPiston) tileentity).clearPistonTileEntity();
      }

      par1World.setBlockAndMetadata(par2, par3, par4, Block.pistonMoving.blockID, i);
      par1World.setBlockTileEntity(
          par2, par3, par4, BlockPistonMoving.getTileEntity(blockID, i, i, false, true));

      if (isSticky) {
        int j = par2 + Facing.offsetsXForSide[i] * 2;
        int k = par3 + Facing.offsetsYForSide[i] * 2;
        int l = par4 + Facing.offsetsZForSide[i] * 2;
        int i1 = par1World.getBlockId(j, k, l);
        int j1 = par1World.getBlockMetadata(j, k, l);
        boolean flag = false;

        if (i1 == Block.pistonMoving.blockID) {
          TileEntity tileentity1 = par1World.getBlockTileEntity(j, k, l);

          if (tileentity1 != null && (tileentity1 instanceof TileEntityPiston)) {
            TileEntityPiston tileentitypiston = (TileEntityPiston) tileentity1;

            if (tileentitypiston.getPistonOrientation() == i && tileentitypiston.isExtending()) {
              tileentitypiston.clearPistonTileEntity();
              i1 = tileentitypiston.getStoredBlockID();
              j1 = tileentitypiston.getBlockMetadata();
              flag = true;
            }
          }
        }

        if (((i1 > 0 && (flag || canPushBlock(i1, par1World, j, k, l, false)) && dupe)
                || (!flag && i1 > 0 && canPushBlock(i1, par1World, j, k, l, false) && !dupe))
            && (Block.blocksList[i1].getMobilityFlag() == 0
                || i1 == Block.pistonBase.blockID
                || i1 == Block.pistonStickyBase.blockID)) {
          par2 += Facing.offsetsXForSide[i];
          par3 += Facing.offsetsYForSide[i];
          par4 += Facing.offsetsZForSide[i];
          par1World.setBlockAndMetadata(par2, par3, par4, Block.pistonMoving.blockID, j1);
          par1World.setBlockTileEntity(
              par2, par3, par4, BlockPistonMoving.getTileEntity(i1, j1, i, false, false));
          ignoreUpdates = false;
          par1World.setBlockWithNotify(j, k, l, 0);
          ignoreUpdates = true;
        } else if (!flag) {
          ignoreUpdates = false;
          par1World.setBlockWithNotify(
              par2 + Facing.offsetsXForSide[i],
              par3 + Facing.offsetsYForSide[i],
              par4 + Facing.offsetsZForSide[i],
              0);
          ignoreUpdates = true;
        }
      } else {
        ignoreUpdates = false;
        par1World.setBlockWithNotify(
            par2 + Facing.offsetsXForSide[i],
            par3 + Facing.offsetsYForSide[i],
            par4 + Facing.offsetsZForSide[i],
            0);
        ignoreUpdates = true;
      }

      par1World.playSoundEffect(
          (double) par2 + 0.5D,
          (double) par3 + 0.5D,
          (double) par4 + 0.5D,
          "tile.piston.in",
          0.5F,
          par1World.rand.nextFloat() * 0.15F + 0.6F);
    }

    ignoreUpdates = false;
  }
Esempio n. 7
0
 @Override
 public void onNeighborBlockChange(World world, int i, int j, int k, int l) {
   if (!mod_NWater.chunkPass(world, i, j, k)) {
     return;
   }
   if (world.getBlockMetadata(i, j, k) < 2) {
     world.scheduleBlockUpdate(i, j, k, blockID, tickRate());
   }
   if (world.multiplayerWorld) {
     return;
   }
   if (BlockNWater_Ocean.noOcean) {
     return;
   }
   checkForHarden(world, i, j, k);
   int i1 = world.getBlockMetadata(i, j, k);
   boolean flag = false;
   if ((world.getBlockId(i, j - 1, k) == mod_NWater.nwater_ocean.blockID)
       & (world.getBlockMetadata(i, j - 1, k) < 2 || world.getBlockMetadata(i, j - 1, k) > 3)) {
     flag = true;
   }
   if (mod_NWater.canMoveAmt(world, i, j - 1, k, i1)) {
     flag = true;
   }
   if (checkSponge(world, i - 1, j, k)) {
     flag = true;
   }
   if (checkSponge(world, i + 1, j, k)) {
     flag = true;
   }
   if (checkSponge(world, i, j - 1, k)) {
     flag = true;
   }
   if (checkSponge(world, i, j, k - 1)) {
     flag = true;
   }
   if (checkSponge(world, i, j, k + 1)) {
     flag = true;
   }
   if ((!flag) & isWater(world, i, j - 1, k)) {
     int j1 = world.getBlockMetadata(i, j - 1, k);
     if (j1 < 15) {
       if (j1 + (1 + i1) < 16) {
         flag = true;
       } else {
         flag = true;
       }
     }
   }
   if (!flag) {
     int k1 = 1;
     int i2 = 1;
     for (int k2 = -1; k2 <= 1; k2++) {
       for (int i3 = -1; i3 <= 1; i3++) {
         int k3 = k2 * k1;
         int i4 = i3 * i2;
         if (!((!flag) & (k2 != 0 || i3 != 0) & (k2 == 0 || i3 == 0))) {
           continue;
         }
         world.getBlockId(i + k3, j, k + i4);
         world.getBlockMetadata(i + k3, j, k + i4);
         boolean flag1 = mod_NWater.canMoveAmt(world, i + k3, j, k + i4, i1);
         if (!((!flag) & flag1)) {
           continue;
         }
         world.getBlockId(i + k3, j - 1, k + i4);
         world.getBlockMetadata(i + k3, j - 1, k + i4);
         flag1 = mod_NWater.canMoveAmt(world, i + k3, j - 1, k + i4, i1);
         if ((!flag) & flag1) {
           flag = true;
         }
         if (!((!flag) & isWater(world, i + k3, j - 1, k + i4))) {
           continue;
         }
         int k5 = world.getBlockMetadata(i + k3, j - 1, k + i4);
         if (k5 >= 15) {
           continue;
         }
         if (k5 + (1 + i1) < 16) {
           flag = true;
         } else {
           flag = true;
         }
       }
     }
   }
   if ((!flag) & (i1 > 0)) {
     int l1 = 1;
     int j2 = 1;
     for (int l2 = -1; l2 <= 1; l2++) {
       for (int j3 = -1; j3 <= 1; j3++) {
         int l3 = l2 * l1;
         int j4 = j3 * j2;
         if (!((!flag) & (l2 != 0 || j3 != 0) & (l2 == 0 || j3 == 0))) {
           continue;
         }
         world.getBlockId(i + l3, j, k + j4);
         int j5 = world.getBlockMetadata(i + l3, j, k + j4);
         boolean flag2 = mod_NWater.canMoveAmt(world, i + l3, j, k + j4, i1);
         if ((!flag) & flag2) {
           flag = true;
         }
         if (!((!flag) & isWater(world, i + l3, j, k + j4))) {
           continue;
         }
         if (j5 + 1 < i1) {
           flag = true;
         }
         float f = getSurfaceMull();
         if (!((!flag)
             & (Math.pow(mod_NWater.getMetaAvg2(world, i + l3, j, k + j4), f)
                 < mod_NWater.getMetaAvg2(world, i, j, k)))) {
           continue;
         }
         int l5 = i1;
         int j6 = (i1 + j5) / 2;
         if (l5 != j6) {
           flag = true;
         }
       }
     }
   }
   if (flag) {
     world.setBlockAndMetadata(i, j, k, getMoving(), i1);
   }
 }
Esempio n. 8
0
  @Override
  public void harvestBlock(World world, EntityPlayer entityplayer, int i, int j, int k, int l) {
    // we need to make sure teh palyer has the correct tool out
    boolean isAxeorSaw = false;
    ItemStack equip = entityplayer.getCurrentEquippedItem();
    if (equip != null) {
      for (int cnt = 0; cnt < Recipes.Axes.length && !isAxeorSaw; cnt++) {
        if (equip.getItem() == Recipes.Axes[cnt]) {
          isAxeorSaw = true;
        }
      }
      for (int cnt = 0; cnt < Recipes.Saws.length && !isAxeorSaw; cnt++) {
        if (equip.getItem() == Recipes.Saws[cnt]) {
          isAxeorSaw = true;
        }
      }
    }
    if (isAxeorSaw) {
      int x = i;
      int y = 0;
      int z = k;
      int count = 0;

      if (world.getBlockId(i, j + 1, k) == blockID || world.getBlockId(i, j - 1, k) == blockID) {
        // super.harvestBlock(world, entityplayer, i, j, k, l);
        boolean checkArray[][][] = new boolean[11][50][11];

        if (TFC_Core.isGrass(world.getBlockId(i, j + y - 1, k))
            || TFC_Core.isDirt(world.getBlockId(i, j + y - 1, k))) {
          boolean reachedTop = false;
          while (!reachedTop) {
            if (l != 9 && l != 15 && world.getBlockId(x, j + y + 1, z) == 0) {
              reachedTop = true;
            } else if ((l == 9 || l == 15)
                && world.getBlockId(x, j + y + 1, z) == 0
                && world.getBlockId(x + 1, j + y + 1, z) != blockID
                && world.getBlockId(x - 1, j + y + 1, z) != blockID
                && world.getBlockId(x, j + y + 1, z + 1) != blockID
                && world.getBlockId(x, j + y + 1, z - 1) != blockID
                && world.getBlockId(x - 1, j + y + 1, z - 1) != blockID
                && world.getBlockId(x - 1, j + y + 1, z + 1) != blockID
                && world.getBlockId(x + 1, j + y + 1, z + 1) != blockID
                && world.getBlockId(x + 1, j + y + 1, z - 1) != blockID) {
              reachedTop = true;
            }

            scanLogs(world, i, j + y, k, l, checkArray, 6, y, 6);

            y++;
          }
        }
      } else if (world.getBlockId(i + 1, j, k) == blockID
          || world.getBlockId(i - 1, j, k) == blockID
          || world.getBlockId(i, j, k + 1) == blockID
          || world.getBlockId(i, j, k - 1) == blockID) {
        Random R = new Random();
        if (R.nextInt(100) > 50 && isAxeorSaw) {
          dropBlockAsItem_do(world, i, j, k, new ItemStack(TFCItems.FruitTreeSapling1, 1, l));
        }
      }
    } else {
      world.setBlockAndMetadata(i, j, k, blockID, l);
    }
  }
Esempio n. 9
0
  @Override
  public void updateTick(World world, int i, int j, int k, Random rand) {
    FloraManager manager = FloraManager.getInstance();
    FloraIndex fi = manager.findMatchingIndex(this.getType(world.getBlockMetadata(i, j, k)));

    float temp = TFC_Climate.getHeightAdjustedTemp(i, j, k);

    if (!world.isRemote
        && world.getBlockTileEntity(i, j, k) != null
        && TFC_Time.currentMonth < 6
        && fi != null
        && temp >= fi.minTemp
        && temp < fi.maxTemp) {
      TileEntityFruitTreeWood te = (TileEntityFruitTreeWood) world.getBlockTileEntity(i, j, k);
      int t = 1;
      if (TFC_Time.currentMonth < 3) t = 2;

      int leafGrowthRate = 20;
      int trunkGrowTime = 30;
      int branchGrowTime = 20;

      // grow upward
      if (te.birthTimeWood + trunkGrowTime < TFC_Time.totalDays()
          && te.height < 3
          && te.isTrunk
          && rand.nextInt(16 / t) == 0
          && (world.getBlockId(i, j + 1, k) == 0
              || world.getBlockId(i, j + 1, k) == TFCBlocks.fruitTreeLeaves.blockID)) {
        world.setBlockAndMetadata(i, j + 1, k, this.blockID, world.getBlockMetadata(i, j, k));
        ((TileEntityFruitTreeWood) world.getBlockTileEntity(i, j + 1, k)).setTrunk(true);
        ((TileEntityFruitTreeWood) world.getBlockTileEntity(i, j + 1, k)).setHeight(te.height + 1);
        ((TileEntityFruitTreeWood) world.getBlockTileEntity(i, j + 1, k)).setBirth();

        ((TileEntityFruitTreeWood) world.getBlockTileEntity(i, j, k)).setBirthWood(trunkGrowTime);
      } else if (te.birthTimeWood + branchGrowTime < TFC_Time.totalDays()
          && te.height == 2
          && te.isTrunk
          && rand.nextInt(16 / t) == 0
          && world.getBlockId(i, j + 1, k) != blockID) {
        int r = rand.nextInt(4);
        if (r == 0 && world.getBlockId(i + 1, j, k) == 0
            || world.getBlockId(i + 1, j, k) == TFCBlocks.fruitTreeLeaves.blockID) {
          world.setBlockAndMetadata(i + 1, j, k, this.blockID, world.getBlockMetadata(i, j, k));
          ((TileEntityFruitTreeWood) world.getBlockTileEntity(i + 1, j, k)).setTrunk(false);
          ((TileEntityFruitTreeWood) world.getBlockTileEntity(i + 1, j, k)).setHeight(te.height);
          ((TileEntityFruitTreeWood) world.getBlockTileEntity(i + 1, j, k)).setBirth();
        } else if (r == 1 && world.getBlockId(i, j, k - 1) == 0
            || world.getBlockId(i, j, k - 1) == TFCBlocks.fruitTreeLeaves.blockID) {
          world.setBlockAndMetadata(i, j, k - 1, this.blockID, world.getBlockMetadata(i, j, k));
          ((TileEntityFruitTreeWood) world.getBlockTileEntity(i, j, k - 1)).setTrunk(false);
          ((TileEntityFruitTreeWood) world.getBlockTileEntity(i, j, k - 1)).setHeight(te.height);
          ((TileEntityFruitTreeWood) world.getBlockTileEntity(i, j, k - 1)).setBirth();
        } else if (r == 2 && world.getBlockId(i - 1, j, k) == 0
            || world.getBlockId(i - 1, j, k) == TFCBlocks.fruitTreeLeaves.blockID) {
          world.setBlockAndMetadata(i - 1, j, k, this.blockID, world.getBlockMetadata(i, j, k));
          ((TileEntityFruitTreeWood) world.getBlockTileEntity(i - 1, j, k)).setTrunk(false);
          ((TileEntityFruitTreeWood) world.getBlockTileEntity(i - 1, j, k)).setHeight(te.height);
          ((TileEntityFruitTreeWood) world.getBlockTileEntity(i - 1, j, k)).setBirth();
        } else if (r == 3 && world.getBlockId(i, j, k + 1) == 0
            || world.getBlockId(i, j, k + 1) == TFCBlocks.fruitTreeLeaves.blockID) {
          world.setBlockAndMetadata(i, j, k + 1, this.blockID, world.getBlockMetadata(i, j, k));
          ((TileEntityFruitTreeWood) world.getBlockTileEntity(i, j, k + 1)).setTrunk(false);
          ((TileEntityFruitTreeWood) world.getBlockTileEntity(i, j, k + 1)).setHeight(te.height);
          ((TileEntityFruitTreeWood) world.getBlockTileEntity(i, j, k + 1)).setBirth();
        }

        ((TileEntityFruitTreeWood) world.getBlockTileEntity(i, j, k)).setBirthWood(branchGrowTime);
      } else if (te.birthTimeWood + 1 < TFC_Time.totalDays()
          && rand.nextInt(leafGrowthRate) == 0
          && world.getBlockId(i, j + 2, k) != blockID) {
        if (world.getBlockId(i, j + 1, k) == 0
            && world.getBlockId(i, j + 2, k) == 0
            && BlockFruitLeaves.canStay(
                world, i, j + 1, k, TFCBlocks.fruitTreeLeaves.blockID)) // above
        {
          world.setBlockAndMetadata(
              i, j + 1, k, TFCBlocks.fruitTreeLeaves.blockID, world.getBlockMetadata(i, j, k));
          world.markBlockForUpdate(i, j + 1, k);
        } else if (world.getBlockId(i + 1, j, k) == 0
            && world.getBlockId(i + 1, j + 1, k) == 0
            && BlockFruitLeaves.canStay(
                world, i + 1, j, k, TFCBlocks.fruitTreeLeaves.blockID)) // +x
        {
          world.setBlockAndMetadata(
              i + 1, j, k, TFCBlocks.fruitTreeLeaves.blockID, world.getBlockMetadata(i, j, k));
          world.markBlockForUpdate(i + 1, j, k);
        } else if (world.getBlockId(i - 1, j, k) == 0
            && world.getBlockId(i - 1, j + 1, k) == 0
            && BlockFruitLeaves.canStay(
                world, i - 1, j, k, TFCBlocks.fruitTreeLeaves.blockID)) // -x
        {
          world.setBlockAndMetadata(
              i - 1, j, k, TFCBlocks.fruitTreeLeaves.blockID, world.getBlockMetadata(i, j, k));
          world.markBlockForUpdate(i - 1, j, k);
        } else if (world.getBlockId(i, j, k + 1) == 0
            && world.getBlockId(i, j + 1, k + 1) == 0
            && BlockFruitLeaves.canStay(
                world, i, j, k + 1, TFCBlocks.fruitTreeLeaves.blockID)) // +z
        {
          world.setBlockAndMetadata(
              i, j, k + 1, TFCBlocks.fruitTreeLeaves.blockID, world.getBlockMetadata(i, j, k));
          world.markBlockForUpdate(i, j, k + 1);
        } else if (world.getBlockId(i, j, k - 1) == 0
            && world.getBlockId(i, j + 1, k - 1) == 0
            && BlockFruitLeaves.canStay(
                world, i, j, k - 1, TFCBlocks.fruitTreeLeaves.blockID)) // -z
        {
          world.setBlockAndMetadata(
              i, j, k - 1, TFCBlocks.fruitTreeLeaves.blockID, world.getBlockMetadata(i, j, k));
          world.markBlockForUpdate(i, j, k - 1);
        } else if (world.getBlockId(i + 1, j, k - 1) == 0
            && world.getBlockId(i + 1, j + 1, k - 1) == 0
            && BlockFruitLeaves.canStay(
                world, i + 1, j, k - 1, TFCBlocks.fruitTreeLeaves.blockID)) // +x/-z
        {
          world.setBlockAndMetadata(
              i + 1, j, k - 1, TFCBlocks.fruitTreeLeaves.blockID, world.getBlockMetadata(i, j, k));
          world.markBlockForUpdate(i + 1, j, k - 1);
        } else if (world.getBlockId(i + 1, j, k + 1) == 0
            && world.getBlockId(i + 1, j + 1, k + 1) == 0
            && BlockFruitLeaves.canStay(
                world, i + 1, j, k + 1, TFCBlocks.fruitTreeLeaves.blockID)) // +x/+z
        {
          world.setBlockAndMetadata(
              i + 1, j, k + 1, TFCBlocks.fruitTreeLeaves.blockID, world.getBlockMetadata(i, j, k));
          world.markBlockForUpdate(i + 1, j, k + 1);
        } else if (world.getBlockId(i - 1, j, k - 1) == 0
            && world.getBlockId(i - 1, j + 1, k - 1) == 0
            && BlockFruitLeaves.canStay(
                world, i - 1, j, k - 1, TFCBlocks.fruitTreeLeaves.blockID)) // -x/-z
        {
          world.setBlockAndMetadata(
              i - 1, j, k - 1, TFCBlocks.fruitTreeLeaves.blockID, world.getBlockMetadata(i, j, k));
          world.markBlockForUpdate(i - 1, j, k - 1);
        } else if (world.getBlockId(i - 1, j, k + 1) == 0
            && world.getBlockId(i - 1, j + 1, k + 1) == 0
            && BlockFruitLeaves.canStay(
                world, i - 1, j, k + 1, TFCBlocks.fruitTreeLeaves.blockID)) // -x/+z
        {
          world.setBlockAndMetadata(
              i - 1, j, k + 1, TFCBlocks.fruitTreeLeaves.blockID, world.getBlockMetadata(i, j, k));
          world.markBlockForUpdate(i - 1, j, k + 1);
        }
      }
    }
  }