Advertisement
Guest User

Untitled

a guest
Sep 11th, 2015
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. package com.mightydanp.eot.item;
  2.  
  3. import com.mightydanp.eot.block.BlockEssenceOre;
  4.  
  5. import net.minecraft.block.Block;
  6. import net.minecraft.item.ItemBlock;
  7. import net.minecraft.item.ItemStack;
  8.  
  9. public class ItemEssenceOre extends ItemBlock{
  10.  
  11. public static String[] subBlocks = new String[] {"" ,"Magic", "Air", "Earth", "Fire", "Water"};
  12.  
  13. public ItemEssenceOre(Block block) {
  14. super(block);
  15. this.setHasSubtypes(true);
  16. }
  17.  
  18. public String getUnlocalizedName(ItemStack itemStack){
  19. int i = itemStack.getItemDamage();
  20. if(i < 0 || i >= subBlocks.length){
  21. i = 0;
  22. }
  23.  
  24. return super.getUnlocalizedName() + subBlocks[i];
  25. }
  26.  
  27. public int getMetaData(int meta){
  28. return meta;
  29. }
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement