From 9e9a2548043efc992b42d402b4ee4b61fe7788dc Mon Sep 17 00:00:00 2001 From: Adubbz Date: Mon, 1 Apr 2013 18:41:26 +1100 Subject: [PATCH] Both Holy and Magic Saplings now require Holy Grass in order to be planted --- .../tdwp_ftw/biomesop/blocks/BlockHolySapling.java | 11 +++++++++++ .../tdwp_ftw/biomesop/blocks/BlockMagicSapling.java | 12 ++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockHolySapling.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockHolySapling.java index 824ea4035..1cf91b978 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockHolySapling.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockHolySapling.java @@ -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 diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMagicSapling.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMagicSapling.java index ec622e194..9fc6ec4b9 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMagicSapling.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMagicSapling.java @@ -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