Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.TheGoldCrayon.Daemonology.blocks;
- import net.minecraft.block.Block;
- import net.minecraft.item.ItemBlock;
- import net.minecraft.item.ItemStack;
- public class ItemBlockMeta extends ItemBlock
- {
- public ItemBlockMeta(Block block)
- {
- super(block);
- if(!(block instanceof IMetaBlockName))
- {
- throw new IllegalArgumentException(String.format("The given Block %s is not an instance of IMetaBlockName", block.getUnlocalizedName()));
- }
- this.setHasSubtypes(true);
- }
- public int getMetaData(int damage)
- {
- return damage;
- }
- @Override
- public String getUnlocalizedName(ItemStack stack)
- {
- return super.getUnlocalizedName(stack) + "." + ((IMetaBlockName)this.block).getSpecialName(stack);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment