BiomesOPlenty/common/biomesoplenty/itemblocks/ItemBlockPetals.java

33 lines
653 B
Java
Raw Normal View History

2013-07-03 07:51:39 +00:00
package biomesoplenty.itemblocks;
2013-05-03 13:00:44 +00:00
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
2013-07-03 07:51:39 +00:00
public class ItemBlockPetals extends ItemBlock
2013-05-03 13:00:44 +00:00
{
2013-05-31 10:34:02 +00:00
private static final String[] petals = new String[] {"bigflowerred", "bigfloweryellow"};
2013-07-03 07:51:39 +00:00
public ItemBlockPetals(int par1)
2013-05-31 10:34:02 +00:00
{
super(par1);
setMaxDamage(0);
setHasSubtypes(true);
}
@Override
public int getMetadata(int meta)
{
return meta & 15;
}
@Override
public String getUnlocalizedName(ItemStack itemStack)
{
int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= petals.length) {
meta = 0;
}
2013-06-09 05:47:52 +00:00
return super.getUnlocalizedName() + "." + petals[meta];
2013-05-31 10:34:02 +00:00
}
2013-05-03 13:00:44 +00:00
}