Advertisement
Guest User

Log Block Item Class

a guest
Sep 28th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1. package com.AdamDoesMods.Biomes.features;
  2.  
  3. import net.minecraft.block.Block;
  4. import net.minecraft.item.ItemBlock;
  5. import net.minecraft.item.ItemStack;
  6.  
  7. public class itemLogBlocks extends ItemBlock {
  8.    
  9.     public static final String[] myStringArray = new String[] {"Aphock", "Dlelbone", "Ootriacca", "Phalea", "Putrid Bunya"};
  10.    
  11.     public itemLogBlocks(Block block) {
  12.         super(block);
  13.         this.setHasSubtypes(true);
  14.     }
  15.    
  16.     public String getUnlocalizedName(ItemStack stack) {
  17.         int i = stack.getItemDamage();
  18.         if(i < 0 || i >= myStringArray.length) {
  19.             i = 0;
  20.         }
  21.        
  22.         return super.getUnlocalizedName() + "." + myStringArray[i];
  23.        
  24.     }
  25.    
  26.     public int getMetadata(int meta) {
  27.         return meta;
  28.     }
  29.    
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement