Advertisement
Guest User

Untitled

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