001package net.minecraft.item; 002 003import cpw.mods.fml.relauncher.Side; 004import cpw.mods.fml.relauncher.SideOnly; 005import net.minecraft.block.Block; 006import net.minecraft.util.Icon; 007 008public class ItemBlockWithMetadata extends ItemBlock 009{ 010 private Block theBlock; 011 012 public ItemBlockWithMetadata(int par1, Block par2Block) 013 { 014 super(par1); 015 this.theBlock = par2Block; 016 this.setMaxDamage(0); 017 this.setHasSubtypes(true); 018 } 019 020 @SideOnly(Side.CLIENT) 021 022 /** 023 * Gets an icon index based on an item's damage value 024 */ 025 public Icon getIconFromDamage(int par1) 026 { 027 return this.theBlock.getBlockTextureFromSideAndMetadata(2, par1); 028 } 029 030 /** 031 * Returns the metadata of the block which this Item (ItemBlock) can place 032 */ 033 public int getMetadata(int par1) 034 { 035 return par1; 036 } 037}