Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.wither.withermod.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 ISpecialBlockName!", block.getUnlocalizedName()));
- }
- this.setMaxDamage(0);
- 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
Advertisement