Advertisement
TechMage66

ItemSwordAlchimia

Aug 20th, 2015
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.39 KB | None | 0 0
  1. package Morpheus420.StormMastery.item;
  2.  
  3. import Morpheus420.StormMastery.StormMastery;
  4. import Morpheus420.StormMastery.reference.Reference;
  5. import cpw.mods.fml.relauncher.Side;
  6. import cpw.mods.fml.relauncher.SideOnly;
  7. import net.minecraft.client.renderer.texture.IIconRegister;
  8. import net.minecraft.item.ItemStack;
  9. import net.minecraft.item.ItemSword;
  10.  
  11. public class ItemSwordAlchimia extends ItemSword
  12. {
  13.     public ItemSwordAlchimia(ToolMaterial material)
  14.     {
  15.         super(material);
  16.         this.setCreativeTab(StormMastery.tabAlchimia);
  17.     }
  18.  
  19.     @Override
  20.     public String getUnlocalizedName()
  21.     {
  22.         return String.format("item.%s%s", Reference.MOD_ID.toLowerCase() + ":", getUnwrappedUnlocalizedName(super.getUnlocalizedName()));
  23.     }
  24.  
  25.     @Override
  26.     public String getUnlocalizedName(ItemStack itemStack)
  27.     {
  28.         return String.format("item.%s%s", Reference.MOD_ID.toLowerCase() + ":", getUnwrappedUnlocalizedName(super.getUnlocalizedName()));
  29.     }
  30.  
  31.     @Override
  32.     @SideOnly(Side.CLIENT)
  33.     public void registerIcons(IIconRegister iconRegister)
  34.     {
  35.         itemIcon = iconRegister.registerIcon(this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
  36.     }
  37.  
  38.     protected String getUnwrappedUnlocalizedName(String unlocalizedName)
  39.     {
  40.         return unlocalizedName.substring(unlocalizedName.indexOf(".") + 1);
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement