mirror of
https://github.com/GTNewHorizons/Tainted-Magic.git
synced 2026-11-28 23:39:15 +00:00
commit source
This commit is contained in:
commit
1381f5b9b4
171 files changed
+7742
No files matched your search
@@ -0,0 +1,56 @@
|
||||
package taintedmagic.common.items.wand;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemWandCap extends Item
|
||||
{
|
||||
public int SUBTYPES = 4;
|
||||
public IIcon[] icons = new IIcon[SUBTYPES];
|
||||
|
||||
public ItemWandCap ()
|
||||
{
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemWandCap");
|
||||
this.setHasSubtypes(true);
|
||||
}
|
||||
|
||||
public EnumRarity getRarity (ItemStack s)
|
||||
{
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (IIconRegister ir)
|
||||
{
|
||||
for (int i = 0; i < icons.length; i++)
|
||||
this.icons[i] = ir.registerIcon("taintedmagic:ItemWandCap" + i);
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public IIcon getIconFromDamage (int i)
|
||||
{
|
||||
return this.icons[i];
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void getSubItems (Item item, CreativeTabs c, List l)
|
||||
{
|
||||
for (int i = 0; i < SUBTYPES; i++)
|
||||
l.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
public String getUnlocalizedName (ItemStack s)
|
||||
{
|
||||
return super.getUnlocalizedName() + "." + s.getItemDamage();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user