001 package net.minecraft.src;
002
003 import cpw.mods.fml.common.Side;
004 import cpw.mods.fml.common.asm.SideOnly;
005 import java.util.List;
006
007 public class BlockLilyPad extends BlockFlower
008 {
009 protected BlockLilyPad(int par1, int par2)
010 {
011 super(par1, par2);
012 float var3 = 0.5F;
013 float var4 = 0.015625F;
014 this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, var4, 0.5F + var3);
015 this.setCreativeTab(CreativeTabs.tabDecorations);
016 }
017
018 /**
019 * The type of render function that is called for this block
020 */
021 public int getRenderType()
022 {
023 return 23;
024 }
025
026 /**
027 * if the specified block is in the given AABB, add its collision bounding box to the given list
028 */
029 public void addCollidingBlockToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity)
030 {
031 if (par7Entity == null || !(par7Entity instanceof EntityBoat))
032 {
033 super.addCollidingBlockToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
034 }
035 }
036
037 /**
038 * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
039 * cleared to be reused)
040 */
041 public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
042 {
043 return AxisAlignedBB.getAABBPool().addOrModifyAABBInPool((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)par3 + this.maxY, (double)par4 + this.maxZ);
044 }
045
046 @SideOnly(Side.CLIENT)
047 public int getBlockColor()
048 {
049 return 2129968;
050 }
051
052 @SideOnly(Side.CLIENT)
053
054 /**
055 * Returns the color this block should be rendered. Used by leaves.
056 */
057 public int getRenderColor(int par1)
058 {
059 return 2129968;
060 }
061
062 @SideOnly(Side.CLIENT)
063
064 /**
065 * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called
066 * when first determining what to render.
067 */
068 public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
069 {
070 return 2129968;
071 }
072
073 /**
074 * Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of
075 * blockID passed in. Args: blockID
076 */
077 protected boolean canThisPlantGrowOnThisBlockID(int par1)
078 {
079 return par1 == Block.waterStill.blockID;
080 }
081
082 /**
083 * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants.
084 */
085 public boolean canBlockStay(World par1World, int par2, int par3, int par4)
086 {
087 return par3 >= 0 && par3 < 256 ? par1World.getBlockMaterial(par2, par3 - 1, par4) == Material.water && par1World.getBlockMetadata(par2, par3 - 1, par4) == 0 : false;
088 }
089 }