daily pastebin goal
41%
SHARE
TWEET

Item BlockDrill

archieab Jan 29th, 2018 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package archieab.andustry.blocks.item;
  2.  
  3. import archieab.andustry.blocks.BlockDrill;
  4. import net.minecraft.block.Block;
  5. import net.minecraft.item.ItemBlock;
  6. import net.minecraft.item.ItemStack;
  7.  
  8. public class ItemBlockDrill extends ItemBlock {
  9.  
  10.     public ItemBlockDrill(Block block) {
  11.         super(block);
  12.         if(!(block instanceof IMetaBlockName)) {
  13.             throw new IllegalArgumentException(String.format("The given Block %s is not an instance of IMetaBlockName!", block.getUnlocalizedName()));
  14.         }
  15.         this.setHasSubtypes(true);
  16.         this.setMaxDamage(0);
  17.     }
  18.    
  19.     @Override
  20.     public String getUnlocalizedName(ItemStack stack) {
  21.         return super.getUnlocalizedName() + "." + ((IMetaBlockName) this.block).getSpecialName(stack);
  22.     }
  23.  
  24.     public int getMetadata(int damage) {
  25.         return damage;
  26.     }
  27.    
  28. }
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top