diff options
| author | bspkrs <bspkrs@gmail.com> | 2013-12-16 14:19:04 -0500 |
|---|---|---|
| committer | bspkrs <bspkrs@gmail.com> | 2013-12-16 14:19:04 -0500 |
| commit | f15bc9e0abff4710d9860bd970b3b6820c5e78c6 (patch) | |
| tree | 6951055018820b7e604f3825a429c91b77e9eb27 /common/darkknight/jewelrycraft/item/ItemMolds.java | |
| parent | 43ef55b2424eb49110e27d603adf95a84bf37560 (diff) | |
tested creation of rings with custom NBT - working!
reformatted source
Diffstat (limited to 'common/darkknight/jewelrycraft/item/ItemMolds.java')
| -rw-r--r-- | common/darkknight/jewelrycraft/item/ItemMolds.java | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/common/darkknight/jewelrycraft/item/ItemMolds.java b/common/darkknight/jewelrycraft/item/ItemMolds.java index 090d53a..25ebe70 100644 --- a/common/darkknight/jewelrycraft/item/ItemMolds.java +++ b/common/darkknight/jewelrycraft/item/ItemMolds.java @@ -14,10 +14,10 @@ import net.minecraft.util.MathHelper; public class ItemMolds extends Item { /** List of molds color names */ - public static final String[] moldsItemNames = new String[] {"ingot", "ring"}; + public static final String[] moldsItemNames = new String[] { "ingot", "ring" }; @SideOnly(Side.CLIENT) - private Icon[] moldsIcons; - + private Icon[] moldsIcons; + public ItemMolds(int par1) { super(par1); @@ -25,9 +25,8 @@ public class ItemMolds extends Item this.setMaxDamage(0); this.setMaxStackSize(1); } - + @SideOnly(Side.CLIENT) - /** * Gets an icon index based on an item's damage value */ @@ -36,20 +35,19 @@ public class ItemMolds extends Item int j = MathHelper.clamp_int(par1, 0, moldsItemNames.length - 1); return this.moldsIcons[j]; } - + /** - * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have - * different names based on their damage or NBT. + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have different names based on + * their damage or NBT. */ public String getUnlocalizedName(ItemStack par1ItemStack) { int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, moldsItemNames.length - 1); return super.getUnlocalizedName() + "." + moldsItemNames[i]; } - + @SuppressWarnings({ "unchecked", "rawtypes" }) @SideOnly(Side.CLIENT) - /** * returns a list of items with the same ID, but different meta (eg: molds returns 16 items) */ @@ -60,12 +58,12 @@ public class ItemMolds extends Item par3List.add(new ItemStack(par1, 1, j)); } } - + @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { this.moldsIcons = new Icon[moldsItemNames.length]; - + for (int i = 0; i < moldsItemNames.length; ++i) { this.moldsIcons[i] = par1IconRegister.registerIcon("jewelrycraft:" + moldsItemNames[i] + this.getIconString()); |
