Guest User

Untitled

a guest
Sep 20th, 2018
569
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.lezink.lezinkmod.common;
  2.  
  3. import java.util.List;
  4.  
  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.creativetab.CreativeTabs;
  9. import net.minecraft.item.Item;
  10. import net.minecraft.item.ItemStack;
  11. import net.minecraft.util.IIcon;
  12.  
  13. public class ItemChestRadar extends Item {
  14.     private String[] type = { "chest_radar" };
  15.     private IIcon[] iconArray;
  16.  
  17.     public ItemChestRadar()
  18.       {
  19.         setMaxStackSize(1);
  20.         setCreativeTab(lezinkmod.lezinktab);
  21.         setUnlocalizedName("chest_radar");
  22.       }
  23.  
  24.     public void registerIcons(IIconRegister iconregister) {
  25.         this.iconArray = new IIcon[this.type.length];
  26.         for (int i = 0; i < this.type.length; i++) {
  27.             this.iconArray[i] = iconregister.registerIcon("lezinkmod:" + this.type[i]);
  28.         }
  29.     }
  30.  
  31.     @SideOnly(Side.CLIENT)
  32.     public void getSubItems(Item Item, CreativeTabs creativeTabs, List list) {
  33.         for (int metadata = 0; metadata < this.type.length; metadata++) {
  34.             list.add(new ItemStack(Item, 1, metadata));
  35.         }
  36.     }
  37.  
  38.     @SideOnly(Side.CLIENT)
  39.     public IIcon getIconFromDamage(int metadata) {
  40.         return (metadata < this.type.length) && (metadata >= 0) ? this.iconArray[metadata] : this.iconArray[0];
  41.     }
  42. }
RAW Paste Data