Moved ItemBlockHolder over from FM mod

Designed to be a very simple ItemBlock class to be used with a block for
better metadata control.
This commit is contained in:
DarkGuardsman 2013-08-26 12:44:11 -04:00
parent 866c254aa7
commit 1cc40cf6dc

View file

@ -0,0 +1,30 @@
package dark.core.items;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
/** Simple itemBlock class for quick use with a block
*
* @author Darkguardsman */
public class ItemBlockHolder extends ItemBlock
{
public ItemBlockHolder(int id)
{
super(id);
this.setMaxDamage(0);
this.setHasSubtypes(true);
}
@Override
public int getMetadata(int damage)
{
return damage;
}
@Override
public String getUnlocalizedName(ItemStack itemStack)
{
return Block.blocksList[this.getBlockID()].getUnlocalizedName() + "." + itemStack.getItemDamage();
}
}