001package net.minecraft.block; 002 003import cpw.mods.fml.relauncher.Side; 004import cpw.mods.fml.relauncher.SideOnly; 005import net.minecraft.client.renderer.texture.IconRegister; 006import net.minecraft.item.Item; 007import net.minecraft.util.Icon; 008 009public class BlockCarrot extends BlockCrops 010{ 011 @SideOnly(Side.CLIENT) 012 private Icon[] field_94364_a; 013 014 public BlockCarrot(int par1) 015 { 016 super(par1); 017 } 018 019 @SideOnly(Side.CLIENT) 020 021 /** 022 * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata 023 */ 024 public Icon getBlockTextureFromSideAndMetadata(int par1, int par2) 025 { 026 if (par2 < 7) 027 { 028 if (par2 == 6) 029 { 030 par2 = 5; 031 } 032 033 return this.field_94364_a[par2 >> 1]; 034 } 035 else 036 { 037 return this.field_94364_a[3]; 038 } 039 } 040 041 /** 042 * Generate a seed ItemStack for this crop. 043 */ 044 protected int getSeedItem() 045 { 046 return Item.carrot.itemID; 047 } 048 049 /** 050 * Generate a crop produce ItemStack for this crop. 051 */ 052 protected int getCropItem() 053 { 054 return Item.carrot.itemID; 055 } 056 057 @SideOnly(Side.CLIENT) 058 public void func_94332_a(IconRegister par1IconRegister) 059 { 060 this.field_94364_a = new Icon[4]; 061 062 for (int i = 0; i < this.field_94364_a.length; ++i) 063 { 064 this.field_94364_a[i] = par1IconRegister.func_94245_a("carrots_" + i); 065 } 066 } 067}