Advertisement
Guest User

Leaves Block Item class

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