diff --git a/src/dark/core/items/ItemBlockHolder.java b/src/dark/core/items/ItemBlockHolder.java new file mode 100644 index 000000000..fb32622a8 --- /dev/null +++ b/src/dark/core/items/ItemBlockHolder.java @@ -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(); + } +}