001 package net.minecraft.src;
002
003 import cpw.mods.fml.common.Side;
004 import cpw.mods.fml.common.asm.SideOnly;
005
006 public class ItemSmoothStone extends ItemBlock
007 {
008 /** Instance of the Block. */
009 private Block theSmoothStoneBlock;
010
011 public ItemSmoothStone(int par1, Block par2Block)
012 {
013 super(par1);
014 this.theSmoothStoneBlock = par2Block;
015 this.setMaxDamage(0);
016 this.setHasSubtypes(true);
017 }
018
019 @SideOnly(Side.CLIENT)
020
021 /**
022 * Gets an icon index based on an item's damage value
023 */
024 public int getIconFromDamage(int par1)
025 {
026 return this.theSmoothStoneBlock.getBlockTextureFromSideAndMetadata(2, par1);
027 }
028
029 /**
030 * Returns the metadata of the block which this Item (ItemBlock) can place
031 */
032 public int getMetadata(int par1)
033 {
034 return par1;
035 }
036
037 public String getItemNameIS(ItemStack par1ItemStack)
038 {
039 int var2 = par1ItemStack.getItemDamage();
040
041 if (var2 < 0 || var2 >= BlockStoneBrick.STONE_BRICK_TYPES.length)
042 {
043 var2 = 0;
044 }
045
046 return super.getItemName() + "." + BlockStoneBrick.STONE_BRICK_TYPES[var2];
047 }
048 }