summaryrefslogtreecommitdiff
path: root/common/darkknight/jewelrycraft/item/ItemMolds.java
diff options
context:
space:
mode:
authorOnyxDarkKnight <sor1n.iliutza16@gmail.com>2013-12-26 01:51:30 +0200
committerOnyxDarkKnight <sor1n.iliutza16@gmail.com>2013-12-26 01:51:30 +0200
commit1b240121e2865f78d3884549cc9465db7c62d5e7 (patch)
tree551c08d1a25d723e8b64661071b1f434b48f8f89 /common/darkknight/jewelrycraft/item/ItemMolds.java
parent1a3455b24d90b0def912c28467cbc51662d660e0 (diff)
Fixed a bug?
Diffstat (limited to 'common/darkknight/jewelrycraft/item/ItemMolds.java')
-rw-r--r--common/darkknight/jewelrycraft/item/ItemMolds.java19
1 files changed, 13 insertions, 6 deletions
diff --git a/common/darkknight/jewelrycraft/item/ItemMolds.java b/common/darkknight/jewelrycraft/item/ItemMolds.java
index 25ebe70..93b30e1 100644
--- a/common/darkknight/jewelrycraft/item/ItemMolds.java
+++ b/common/darkknight/jewelrycraft/item/ItemMolds.java
@@ -17,7 +17,7 @@ public class ItemMolds extends Item
public static final String[] moldsItemNames = new String[] { "ingot", "ring" };
@SideOnly(Side.CLIENT)
private Icon[] moldsIcons;
-
+
public ItemMolds(int par1)
{
super(par1);
@@ -25,7 +25,7 @@ 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
@@ -35,7 +35,7 @@ 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.
@@ -45,7 +45,7 @@ public class ItemMolds extends Item
int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, moldsItemNames.length - 1);
return super.getUnlocalizedName() + "." + moldsItemNames[i];
}
-
+
@SuppressWarnings({ "unchecked", "rawtypes" })
@SideOnly(Side.CLIENT)
/**
@@ -58,15 +58,22 @@ 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());
}
}
+
+ @Override
+ public Item setUnlocalizedName(String name)
+ {
+ Item r = super.setUnlocalizedName(name);
+ return r.setTextureName(name.toLowerCase().replaceAll("\\.", ":"));
+ }
}