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