Merge pull request #11 from Adubbz/Sapling_Changes

Sapling Changes
This commit is contained in:
ted 2013-04-02 11:27:48 -07:00
commit a9884181a8
2 changed files with 23 additions and 0 deletions

View file

@ -43,6 +43,17 @@ public class BlockHolySapling extends BlockSapling
{
return this.blockIcon[0];
}
/**
* Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants.
*/
@Override
public boolean canBlockStay(World par1World, int par2, int par3, int par4)
{
Block soil = blocksList[par1World.getBlockId(par2, par3 - 1, par4)];
return (par1World.getFullBlockLightValue(par2, par3, par4) >= 8 || par1World.canBlockSeeTheSky(par2, par3, par4)) &&
(soil != null && soil.blockID == mod_BiomesOPlenty.holyGrass.blockID);
}
/**
* Ticks the block if it's been scheduled

View file

@ -19,6 +19,7 @@ import net.minecraft.world.gen.feature.WorldGenerator;
import tdwp_ftw.biomesop.worldgen.WorldGenMystic2;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Icon;
import net.minecraftforge.common.ForgeDirection;
public class BlockMagicSapling extends BlockSapling
{
@ -43,6 +44,17 @@ public class BlockMagicSapling extends BlockSapling
{
return this.blockIcon[0];
}
/**
* Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants.
*/
@Override
public boolean canBlockStay(World par1World, int par2, int par3, int par4)
{
Block soil = blocksList[par1World.getBlockId(par2, par3 - 1, par4)];
return (par1World.getFullBlockLightValue(par2, par3, par4) >= 8 || par1World.canBlockSeeTheSky(par2, par3, par4)) &&
(soil != null && soil.blockID == mod_BiomesOPlenty.holyGrass.blockID);
}
/**
* Ticks the block if it's been scheduled