BiomesOPlenty/common/biomesoplenty/itemblocks/ItemBlockGrass.java
2013-09-13 16:44:22 +10:00

32 lines
672 B
Java

package biomesoplenty.itemblocks;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class ItemBlockGrass extends ItemBlock
{
private static final String[] types = new String[] {"holygrass", "smolderinggrass"};
public ItemBlockGrass(int par1)
{
super(par1);
setMaxDamage(0);
setHasSubtypes(true);
}
@Override
public int getMetadata(int meta)
{
return meta;
}
@Override
public String getUnlocalizedName(ItemStack itemstack) {
int meta = itemstack.getItemDamage();
if (meta < 0 || meta >= types.length) {
meta = 0;
}
return super.getUnlocalizedName() + "." + types[meta];
}
}